-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
63 lines (58 loc) · 1.33 KB
/
docker-compose.yaml
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
version: "3"
services:
db:
image: postgres:15-alpine
environment:
- POSTGRES_DB=johar
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
restart: unless-stopped
volumes:
- pg_data:/var/lib/postgresql/data/
cache:
image: redis:alpine3.18
restart: unless-stopped
frontend:
image: kysre/johar-frontend:${FRONTEND_IMAGE_TAG}
restart: unless-stopped
deploy:
mode: replicated
replicas: ${FRONTEND_REPLICA_COUNT}
backend:
image: kysre/johar:${BACKEND_IMAGE_TAG}
environment:
- DJANGO_SETTINGS_MODULE=johar.settings.production
- ALLOWED_HOSTS=*
- DATABASE_URL=postgres://postgres:postgres@db:5432/johar
- REDIS_HOST=cache
- NEWS_REDIS_DB=1
- NEWS_SUGGESTION_COUNT=5
restart: unless-stopped
depends_on:
- db
- cache
deploy:
mode: replicated
replicas: ${BACKEND_REPLICA_COUNT}
volumes:
- static:/code/static
- media:/code/media
reverse_proxy:
build:
context: ./nginx
restart: unless-stopped
depends_on:
- backend
- frontend
ports:
- "8000:80"
volumes:
- static:/usr/share/nginx/html/backend/static
- media:/usr/share/nginx/html/backend/media
volumes:
pg_data:
driver: local
static:
driver: local
media:
driver: local