forked from Clay-Ferguson/quantizr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-dev-mongo.yaml
43 lines (37 loc) · 1.71 KB
/
docker-compose-dev-mongo.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
version: '3.7'
services:
# Note: Container Names are automatically available as 'host names' (as in networking http://host:port)
# Networked service-to-service communication use the CONTAINER_PORT in [host]:[container] pairs below.
# Theoretically it should have been possible to let mongo run internally on 27017 (it's default) and then expose it
# to the outside as 27016, but I never could get that to work, so I'm just setting it up to run at 27016 both
# internaly and externally
#
# NOTE: Minimal requirements for the mongod.conf is to have the port set as 27016, and the data db set
mongo-dev:
container_name: mongo-dev
# WARNING: volumes will not handle '~' character for home folder. Do not use.
volumes:
- '${MONGO_BASE}/mongodb-data-dev:/data/db'
- '${MONGO_BASE}/mongo-scripts-dev:/mongo-scripts'
- '${MONGOD_CONF}:/etc/mongod.conf'
command: mongod --config /etc/mongod.conf
#entrypoint: ["mongod","--config","/etc/mongod.conf"]
ports:
- '${MONGO_PORT}:${MONGO_PORT}'
# NOTE: Leave this as an example of how to read env from a file.
# env_file:
# - '${SECRETS}/mongo.env'
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: ${subnodePassword}
networks:
- net-dev
# Always specify version of mongo. When it upgrades automatically there can be database issues that need to be resolved
# and we don't want that happening unexpectedly
image: mongo:4.0
# https://docs.docker.com/compose/networking/
networks:
net-dev:
driver: bridge
external: false
name: net-dev