-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose-prod.yml
77 lines (73 loc) · 2.07 KB
/
docker-compose-prod.yml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
services:
mongo:
container_name: cc-mongo
image: mongo
networks:
- cubingcontests
ports:
- 127.0.0.1:27017:27017
volumes:
- cubingcontests-db:/data/db:rw
- cubingcontests-configdb:/data/configdb:rw
# The scripts in docker-entrypoint-initdb.d are run when the container and volume are first created
- mongo-init:/docker-entrypoint-initdb.d:ro
environment:
- MONGO_INITDB_ROOT_USERNAME=$MONGO_ADMIN_USERNAME
- MONGO_INITDB_ROOT_PASSWORD=$MONGO_ADMIN_PASSWORD
- MONGO_DEV_USERNAME=$MONGO_DEV_USERNAME
- MONGO_DEV_PASSWORD=$MONGO_DEV_PASSWORD
restart: always
server:
container_name: cc-server # if this is ever changed, make sure to update all references to the old container name in the code
image: '${DOCKER_IMAGE_PREFIX}cubingcontests-server:${VERSION}'
networks:
- cubingcontests
ports:
- 127.0.0.1:$BACKEND_PORT:$BACKEND_PORT
env_file: .env
environment:
- NODE_ENV=production
- PORT=$BACKEND_PORT
- MONGO_DEV_USERNAME=$MONGO_DEV_USERNAME
- MONGO_DEV_PASSWORD=$MONGO_DEV_PASSWORD
- JWT_SECRET=$JWT_SECRET
- BASE_URL=$BASE_URL
depends_on:
- mongo
restart: always
server2:
container_name: cc-server2 # if this is changed, make sure to update all references to the old container name in .env
image: '${DOCKER_IMAGE_PREFIX}cubingcontests-server2:${VERSION}'
networks:
- cubingcontests
ports:
- 127.0.0.1:$BACKEND2_PORT:$BACKEND2_PORT
env_file: .env
depends_on:
- mongo
restart: always
client:
container_name: cc-client
image: '${DOCKER_IMAGE_PREFIX}cubingcontests-client:${VERSION}'
networks:
- cubingcontests
ports:
- 127.0.0.1:$FRONTEND_PORT:$FRONTEND_PORT
depends_on:
- mongo
- server
- server2
restart: always
networks:
cubingcontests:
volumes:
cubingcontests-db:
driver: local
cubingcontests-configdb:
driver: local
mongo-init:
driver: local
driver_opts:
type: none
o: bind
device: ./mongo_init