forked from andresja75/ft_transcendence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
82 lines (79 loc) · 2.03 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
version: '3'
networks:
transcendence-network:
name: transcendence-network
services:
postgresql:
image: postgres:15.5-alpine3.18
container_name: postgresql
hostname: postgresql
networks:
- transcendence-network
environment:
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_DB_NAME: "${POSTGRES_DB_NAME}"
restart: unless-stopped
volumes:
- db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} && psql -U ${POSTGRES_USER} -c 'SELECT datname FROM pg_database;' | grep -q ${POSTGRES_DB_NAME}"]
interval: 2s
timeout: 2s
retries: 20
backend:
container_name: backend
build: backend/
networks:
- transcendence-network
environment:
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_DB_NAME: "${POSTGRES_DB_NAME}"
DJANGO_DEBUG: "False" # if this value is not set or set to anything not 'False', django will
# run in production mode
DJANGO_SECRET_KEY: "${DJANGO_SECRET_KEY}"
healthcheck:
test: ["CMD-SHELL", "python manage.py check"]
interval: 5s
timeout: 5s
retries: 20
depends_on:
postgresql:
condition: service_healthy
volumes:
- backend:/app
restart: unless-stopped
caddy:
image: caddy:alpine
container_name: caddy
depends_on:
backend:
condition: service_healthy
cap_add:
- NET_ADMIN
ports:
- "80:80"
- "443:443"
- "443:443/udp"
networks:
- transcendence-network
volumes:
- $PWD/caddy/Caddyfile:/etc/caddy/Caddyfile
- $PWD/caddy/data:/data
- $PWD/caddy/conf:/config
- $PWD/backend/static/:/static/
restart: unless-stopped
volumes:
db:
driver: local
driver_opts:
type: none
o: bind
device: "${DB_PATH}"
backend:
driver: local
driver_opts:
type: none
o: bind
device: "${PWD}/backend"