-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
94 lines (88 loc) · 2.58 KB
/
docker-compose.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
services:
postgres:
build: ./srcs/database-postgres
image: postgres
container_name: postgres
expose:
- "5432"
volumes:
- db-data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=${DB_PASS}
- POSTGRES_USER=${DB_USER}
- POSTGRES_DB=${DB_NAME}
networks:
- pong-network
restart: on-failure
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "${DB_NAME}"]
interval: 30s
timeout: 60s
retries: 5
start_period: 90s
backend-django:
build: ./srcs/backend
image: backend-django
container_name: backend-django
expose:
- "8000"
environment:
- DB_PASS=${DB_PASS}
- DB_USER=${DB_USER}
- DB_NAME=${DB_NAME}
- DB_HOST=postgres
- DB_PORT=5432
- JWT_SECRET_KEY=${JWT_SECRET_KEY}
- EMAIL_HOST=${EMAIL_HOST}
- EMAIL_PORT=${EMAIL_PORT}
- EMAIL_USE_TLS=${EMAIL_USE_TLS}
- EMAIL_HOST_USER=${EMAIL_HOST_USER}
- EMAIL_HOST_PASSWORD=${EMAIL_HOST_PASSWORD}
- TWILIO_ACCOUNT_SID=${TWILIO_ACCOUNT_SID}
- TWILIO_AUTH_TOKEN=${TWILIO_AUTH_TOKEN}
- TWILIO_PHONE_NUMBER=${TWILIO_PHONE_NUMBER}
- BACKEND_DEBUG_MODE=${BACKEND_DEBUG_MODE}
- CRYPTOGRAPHER_PRIVATE_KEY=${CRYPTOGRAPHER_PRIVATE_KEY}
- CRYPTOGRAPHER_PUBLIC_KEY=${CRYPTOGRAPHER_PUBLIC_KEY}
- DOMAIN=${DOMAIN}
- PORT=${PORT}
networks:
- pong-network
restart: on-failure
depends_on:
postgres:
condition: service_healthy
nginx-server:
build: ./srcs/frontend
image: nginx-server
container_name: nginx-server
expose:
- "80"
environment:
- NGINX_HOST=127.0.0.1
- NGINX_PORT=80
- DOMAIN=${DOMAIN}
- PORT=${PORT}
networks:
- pong-network
restart: on-failure
reverse-proxy:
build: ./srcs/reverse_proxy
image: reverse-proxy
container_name: reverse-proxy
ports:
- "${PORT}:443"
environment:
- NGINX_HOST=127.0.0.1
- DOMAIN=${DOMAIN}
networks:
- pong-network
restart: on-failure
depends_on:
- backend-django
networks:
pong-network:
name: pong-network
volumes:
db-data:
name: blitzpong_database