forked from devsoc-unsw/circles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
117 lines (109 loc) · 2.57 KB
/
docker-compose.yaml
File metadata and controls
117 lines (109 loc) · 2.57 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
services:
mongodb:
image: mongo:6.0.14
container_name: circles-mongodb
volumes:
# Named volume to persist database
- circles_data:/data/db
env_file:
- ./env/mongodb.env
networks:
- circles-net
ports:
- '27017:27017'
sessionsdb:
image: redis/redis-stack:7.2.0-v9
container_name: circles-sessionsdb
ports:
- '8001:8001'
- '6379:6379'
env_file:
- ./env/sessionsdb.env
volumes:
- ./backend/redis.conf:/redis-stack.conf
networks:
- circles-net
backend:
build:
context: ./backend
dockerfile: dev.dockerfile
container_name: circles-backend
ports:
- '8000:8000'
env_file:
- ./env/backend.env
# tty: true
depends_on:
- mongodb
- sessionsdb
networks:
- circles-net
volumes:
# Bind mount volume for live backend updates while developing
- ./backend:/backend
backend-prod:
build:
context: ./backend
dockerfile: production.dockerfile
container_name: circles-backend-prod
ports:
- '8000:8000'
env_file:
- ./env/backend.env
depends_on:
- mongodb
- sessionsdb
networks:
- circles-net
healthcheck: # mainly just for ci
test: "curl -sf http://localhost:8000/ping || exit 1"
timeout: 10s
interval: 30s
start_period: 60s
start_interval: 10s
retries: 3
frontend:
build:
context: ./frontend
dockerfile: dev.dockerfile
container_name: circles-frontend
ports:
- '3000:3000'
env_file:
- ./env/frontend.env
volumes:
# Bind mount volume for live frontend updates while developing
- ./frontend/src:/client/src
stdin_open: true
tty: true
depends_on:
- backend
networks:
- circles-net
frontend-prod:
build:
context: ./frontend
dockerfile: production.dockerfile
container_name: circles-frontend-prod
ports:
- '3000:80'
env_file:
- ./env/frontend.env
stdin_open: true
tty: true
depends_on:
- backend-prod
networks:
- circles-net
ci-backend:
# Utility to run the backend with a entirely clean database for testing
# Should be identical to the backend production, except for the different entrypoint
extends: backend-prod
container_name: circles-ci-backend
# THIS IS IMPORTANT
entrypoint: ["python3", "-u", "runserver.py", "--overwrite-all-data"]
# Note only named volumes need to be listed here for persistance.
volumes:
circles_data:
networks:
circles-net: