-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
79 lines (76 loc) · 1.88 KB
/
docker-compose.yml
File metadata and controls
79 lines (76 loc) · 1.88 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
services:
web:
build:
context: .
dockerfile: Dockerfile
command:
- granian
- --interface
- asgi
- --host
- 0.0.0.0
- --port
- "8000"
- --workers
- "2"
- --blocking-threads
- "4"
- config.asgi:application
env_file:
- .env.example
environment:
DJANGO_DEBUG: "0"
DJANGO_ALLOWED_HOSTS: localhost,127.0.0.1
DJANGO_CSRF_TRUSTED_ORIGINS: http://localhost,http://127.0.0.1
POSTGRES_HOST: db
POSTGRES_PORT: "5432"
POSTGRES_DB: pybehaviorlog
POSTGRES_USER: pybehaviorlog
POSTGRES_PASSWORD: pybehaviorlog
REDIS_URL: redis://redis:6379/1
SESSION_COOKIE_SECURE: "0"
CSRF_COOKIE_SECURE: "0"
volumes:
- .:/app
- staticfiles:/app/staticfiles
- media:/app/media
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "python -c \"import json, urllib.request; data=json.load(urllib.request.urlopen('http://127.0.0.1:8000/health/', timeout=3)); assert data.get('status') == 'ok'\""]
interval: 30s
timeout: 5s
retries: 5
ports:
- "8000:8000"
db:
image: postgres:18-bookworm
environment:
POSTGRES_DB: pybehaviorlog
POSTGRES_USER: pybehaviorlog
POSTGRES_PASSWORD: pybehaviorlog
healthcheck:
test: ["CMD-SHELL", "pg_isready -U pybehaviorlog -d pybehaviorlog"]
interval: 10s
timeout: 5s
retries: 10
volumes:
- postgres18_data:/var/lib/postgresql/data
redis:
image: redis:8-bookworm
command: ["redis-server", "--appendonly", "yes"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 10
volumes:
- redis8_data:/data
volumes:
postgres18_data:
redis8_data:
staticfiles:
media: