-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
51 lines (49 loc) · 1.13 KB
/
docker-compose.yml
File metadata and controls
51 lines (49 loc) · 1.13 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
services:
db:
image: postgres
restart: always
shm_size: 128mb
env_file:
- .env.docker
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
ports:
- "${DB_PORT}:${DB_PORT}"
healthcheck:
test: ["CMD", "pg_isready", "-U", "${DB_USER}", "-d", "${DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
backend:
env_file: .env.docker
build:
context: ./backend
dockerfile: ./Dockerfile
args:
- BACKEND_PORT:${BACKEND_PORT}
restart: always
command: >
bash -c "
python manage.py makemigrations &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:${BACKEND_PORT}
"
ports:
- "${BACKEND_PORT}:${BACKEND_PORT}"
depends_on:
db:
condition: service_healthy
frontend:
env_file: .env.docker
build:
context: ./frontend
dockerfile: ./Dockerfile
args:
- FRONTEND_PORT:${FRONTEND_PORT}
restart: always
ports:
- "${CLIENT_PORT}:${FRONTEND_PORT}"
depends_on:
- backend