forked from TheSecretOrganization/ft_transcendence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
116 lines (110 loc) · 2.18 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: ft
services:
django:
container_name: django
build:
context: django
args:
DJANGO_SUPERUSER_USERNAME: ${DJANGO_SUPERUSER_USERNAME}
HOSTNAME: ${HOSTNAME}
expose:
- 443
init: true
networks:
- network
volumes:
- static-files:/static
- media-files:/app/media
- ssl-keys:/ssl
env_file:
- .env
develop:
watch:
- action: sync+restart
path: ./django/src/
target: /app/
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: [ "CMD-SHELL", "python manage.py healthcheck || exit 1" ]
interval: 2s
timeout: 2s
retries: 5
start_period: 5s
nginx:
container_name: nginx
build:
context: nginx
args:
HOSTNAME: ${HOSTNAME}
ports:
- 4443:443
init: true
networks:
- network
volumes:
- static-files:/static
- media-files:/media
- ssl-keys:/ssl
env_file:
- .env
develop:
watch:
- action: sync
path: ./nginx/src/
target: /usr/share/nginx/
depends_on:
django:
condition: service_healthy
healthcheck:
test: [ "CMD", "nginx", "-t" ]
interval: 2s
timeout: 2s
retries: 5
start_period: 5s
postgres:
container_name: postgres
image: postgres:16.3
ports:
- 5432:5432
networks:
- network
volumes:
- postgres-data:/var/lib/postgresql/data
env_file:
- .env
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB} || exit 1" ]
interval: 2s
timeout: 2s
retries: 5
start_period: 5s
redis:
container_name: redis
image: redis:7.4
expose:
- 6379
networks:
- network
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 2s
timeout: 2s
retries: 5
start_period: 5s
networks:
network:
name: network
driver: bridge
volumes:
static-files:
driver: local
media-files:
driver: local
ssl-keys:
driver: local
postgres-data:
driver: local