-
Notifications
You must be signed in to change notification settings - Fork 633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to customize the configuration file by docker-compose.yml? #359
Comments
docker-compose.yml version: "3"
services:
mongod:
image: mongo:4.1.13
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: test
MONGO_INITDB_ROOT_PASSWORD: test
deploy:
replicas: 1
volumes:
- /root/data/mongod:/root/data
- /root/logs/mongod:/root/logs
- ./mongod.conf:/etc/mongod.conf
ports:
- 27017:27017
command: --config /etc/mongod.conf mongod.conf systemLog:
verbosity: 0
destination: file
path: /root/logs/mongod.log
timeStampFormat: iso8601-utc
storage:
directoryPerDB: true
dbPath: /root/data
engine: wiredTiger
wiredTiger:
engineConfig:
cacheSizeGB: 1
journal:
enabled: true
processManagement:
fork: true
net:
port: 27017
bindIp: 0.0.0.0
security:
authorization: enabled I can't start this service. |
Have you found a way? I have this problem, too. |
version: "3"
services:
mongod:
image: mongo:4.1.13
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: test
MONGO_INITDB_ROOT_PASSWORD: test
deploy:
replicas: 1
volumes:
- /root/data/mongod:/root/data
- /root/logs/mongod:/root/logs
- ./mongod.conf:/etc/mongod.conf
entrypoint: ["mongod","--config","/etc/mongod.conf"]
ports:
- 27017:27017 add |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I want to start the mongodb service in docker-compose.yml and specify the database directory and log file output through a custom configuration file. How do I do this?
The text was updated successfully, but these errors were encountered: