-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
57 lines (51 loc) · 1.16 KB
/
docker-compose.yml
File metadata and controls
57 lines (51 loc) · 1.16 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
version: '3.9'
services:
db:
image: postgres:16
environment:
POSTGRES_DB: notes_db
POSTGRES_USER: notes_user
POSTGRES_PASSWORD: notes_pass
env_file:
- .env
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U notes_user -d notes_db"]
interval: 5s
timeout: 5s
retries: 5
web:
user: root
build: .
command: >
sh -c "
python manage.py migrate &&
python manage.py collectstatic --noinput &&
gunicorn core.wsgi:application --bind 0.0.0.0:8000
"
volumes:
- ./app:/app
- static_volume:/app/static
- media_volume:/app/media
environment:
POSTGRES_DB: notes_db
POSTGRES_USER: notes_user
POSTGRES_PASSWORD: notes_pass
depends_on:
db:
condition: service_healthy
nginx:
image: nginx:alpine
ports:
- "8000:80"
volumes:
- static_volume:/app/static
- media_volume:/app/media
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- web
volumes:
postgres_data:
static_volume:
media_volume: