Browse Source

add docker-compose

master
zeus 4 years ago
parent
commit
4b101a8100
  1. 4
      files/mongo/.env
  2. 32
      files/mongo/docker-compose.yml
  3. 45
      files/mongo/mongod.conf
  4. 5
      files/mongo/package.json
  5. 0
      files/mongo/venus-stats.js

4
files/mongo/.env

@ -0,0 +1,4 @@
# MongoDB
MONGO_INITDB_ROOT_USERNAME=swarmlab
MONGO_INITDB_ROOT_PASSWORD=swarmlab
MONGO_INITDB_DATABASE=venus

32
files/mongo/docker-compose.yml

@ -0,0 +1,32 @@
version: '3.8'
services:
swlabmongovenus:
hostname: 'swlabmongovenus'
container_name: 'swlabmongovenus'
image: 'mongo:4.2'
restart: 'on-failure'
expose:
- 27017
ports:
- 30001:27017
networks:
- netswlabmongovenusLocal
volumes:
- swlabmongovenusData:/data/db
- swlabmongovenusLog:/var/log/mongodb
- ./mongod.conf:/etc/mongod.conf
env_file:
- .env
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
MONGO_INITDB_DATABASE: ${MONGO_INITDB_DATABASE}
volumes:
swlabmongovenusData:
swlabmongovenusLog:
networks:
netswlabmongovenusLocal:

45
files/mongo/mongod.conf

@ -0,0 +1,45 @@
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
dbPath: /data/db
journal:
enabled: true
# engine:
# mmapv1:
# wiredTiger:
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
# network interfaces
net:
port: 27017
bindIp: 127.0.0.1
# how the process runs
processManagement:
timeZoneInfo: /usr/share/zoneinfo
security:
authorization: enabled
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options:
#auditLog:
#snmp:

5
files/mongo/package.json

@ -0,0 +1,5 @@
{
"dependencies": {
"mongodb": "^3.6.6"
}
}

0
files/venus-stats.js → files/mongo/venus-stats.js

Loading…
Cancel
Save