forked from cubing/cubingcontests.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-prod.yml
77 lines (73 loc) · 2.3 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 # if this is ever changed, make sure to update all references to the old container name
image: mongo
networks:
- cubingcontests
ports:
- 127.0.0.1:27017:27017 # if this is ever changed, make sure to update all references to the old port
volumes:
- mongo:/data/db:rw
- mongo-configdb:/data/configdb:rw
- /home/dev/cubing-contests/db_utils/mongo_init:/docker-entrypoint-initdb.d:ro
environment:
- MONGO_INITDB_ROOT_USERNAME=$DB_ADMIN_USERNAME
- MONGO_INITDB_ROOT_PASSWORD=$DB_ADMIN_PASSWORD
- DB_USERNAME=$DB_USERNAME
- DB_PASSWORD=$DB_PASSWORD
- DB_NAME=$DB_NAME
restart: always
postgres:
container_name: cc-postgres # if this is ever changed, make sure to update all references to the old container name
image: postgres:17-alpine
networks:
- cubingcontests
ports:
- 127.0.0.1:5432:5432 # if this is ever changed, make sure to update all references to the old port
volumes:
- pg:/var/lib/postgresql/data:rw
- /home/dev/cubing-contests/db_utils/pg_init:/docker-entrypoint-initdb.d:ro
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=$DB_ADMIN_USERNAME
- POSTGRES_PASSWORD=$DB_ADMIN_PASSWORD
- DB_USERNAME=$DB_USERNAME
- DB_PASSWORD=$DB_PASSWORD
- DB_NAME=$DB_NAME
restart: unless-stopped
server:
container_name: cc-server # if this is ever changed, make sure to update all references to the old container name
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
- MONGODB_HOSTNAME=cc-mongo
depends_on:
- mongo
restart: always
client:
container_name: cc-client # if this is ever changed, make sure to update all references to the old container name
image: '${DOCKER_IMAGE_PREFIX}cubingcontests-client:${VERSION}'
networks:
- cubingcontests
ports:
- 127.0.0.1:$PORT:$PORT
env_file: .env
depends_on:
- mongo
- postgres
- server
restart: always
networks:
cubingcontests:
volumes:
mongo:
driver: local
mongo-configdb:
driver: local
pg:
driver: local