-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yml
96 lines (96 loc) · 2.24 KB
/
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
x-service: &service
build:
dockerfile: ./docker/backend/Dockerfile
context: ./
env_file:
- .env
image: ${COMPOSE_PROJECT_NAME}/backend-${ENVIRONMENT}
volumes:
- logs:/logs
- static:/code/static/
- attachments:/code/attachments/
services:
api:
<<: *service
container_name: ${COMPOSE_PROJECT_NAME}-api-${ENVIRONMENT}
command:
- prod
depends_on:
db:
condition: service_healthy
celery:
<<: *service
depends_on:
- cache
command: celery worker -l INFO -Q django
container_name: ${COMPOSE_PROJECT_NAME}-celery-${ENVIRONMENT}
db:
image: postgres:16
container_name: ${COMPOSE_PROJECT_NAME}-db-${ENVIRONMENT}
restart: unless-stopped
env_file:
- .env
volumes:
- postgres_data:/var/lib/postgresql/data/
caddy:
container_name: ${COMPOSE_PROJECT_NAME}-caddy-${ENVIRONMENT}
image: caddy:2.8.4
env_file:
- .env
ports:
- "${SERVICE_PORT:-80}:80"
volumes:
- static:/static
- attachments:/attachments
- docs:/docs
- caddy_data:/data
- caddy_config:/config
- frontend_data:/usr/share/web
- ./docker/caddy/Caddyfile:/etc/caddy/Caddyfile
depends_on:
api:
condition: service_started
frontend:
condition: service_completed_successfully
docs:
condition: service_completed_successfully
cache:
image: valkey/valkey:bookworm
volumes:
- cache_data:/data
container_name: ${COMPOSE_PROJECT_NAME}-cache-${ENVIRONMENT}
docs:
build:
dockerfile: ./docker/docs/Dockerfile
context: ./
env_file:
- .env
image: ${COMPOSE_PROJECT_NAME}/docs
container_name: ${COMPOSE_PROJECT_NAME}-docs-${ENVIRONMENT}
command:
- build
volumes:
- ./docs:/code/docs
- docs:/code/doc_site
frontend:
build:
dockerfile: ./docker/frontend/Dockerfile
context: ./
env_file:
- .env
command:
- build
image: ${COMPOSE_PROJECT_NAME}/frontend
container_name: ${COMPOSE_PROJECT_NAME}-frontend-${ENVIRONMENT}
volumes:
- frontend_data:/frontend/dist
volumes:
logs:
static:
attachments:
caddy_data:
caddy_config:
postgres_data:
docs:
cache_data:
frontend_data: