-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
107 lines (101 loc) · 2.9 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
version: '3.8'
volumes:
studunimi-backend_postgres:
external: true
studunimi-backend_userbot-sessions:
external: true
static_files:
networks:
db_net:
driver: overlay
django_net:
driver: overlay
traefik_net:
external: true
services:
postgres:
image: postgres:12
container_name: studentiunimi_backend_postgres
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DBNAME}
volumes:
- studunimi-backend_postgres:/var/lib/postgresql/data
networks:
- db_net
healthcheck:
test: pg_isready || exit 1
interval: 30s
timeout: 10s
start_period: 30s
retries: 3
deploy:
replicas: 1
django:
image: ghcr.io/studentiunimi/backend:latest
container_name: studentiunimi_backend_django
environment:
- SERVER_NAME=${SERVER_NAME}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DBNAME=${POSTGRES_DBNAME}
- SECRET_KEY=${SECRET_KEY}
- LOGGING_CHAT_ID=${LOGGING_CHAT_ID}
- LOGGING_BOT_TOKEN=${LOGGING_BOT_TOKEN}
- TELEGRAM_API_ID=${TELEGRAM_API_ID}
- TELEGRAM_API_HASH=${TELEGRAM_API_HASH}
- SENTRY_DSN=${SENTRY_DSN}
- TELEGRAM_ADMIN_GROUP_ID=${TELEGRAM_ADMIN_GROUP_ID}
- GROUPHELP_BLOCKLIST_URL=${GROUPHELP_BLOCKLIST_URL}
volumes:
- static_files:/usr/src/app/static/
- studunimi-backend_userbot-sessions:/usr/src/app/media/userbot-sessions
depends_on:
- postgres
networks:
- db_net
- django_net
nginx:
image: nginx:latest
container_name: studentiunimi_backend_nginx
volumes:
- ./config/nginx.conf:/etc/nginx/conf.d/nginx.conf
- static_files:/static
networks:
- django_net
- traefik_net
depends_on:
- django
healthcheck:
test: curl -f http://127.0.0.1:8000/healthcheck || exit 1
interval: 1m
timeout: 10s
start_period: 10s
retries: 3
deploy:
labels:
- "traefik.enable=true"
- "traefik.http.services.studunimi-backend.loadbalancer.server.port=8000"
tasks:
image: ghcr.io/studentiunimi/backend-tasks:latest
environment:
- SERVER_NAME=${SERVER_NAME}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DBNAME=${POSTGRES_DBNAME}
- SECRET_KEY=${SECRET_KEY}
- LOGGING_CHAT_ID=${LOGGING_CHAT_ID}
- LOGGING_BOT_TOKEN=${LOGGING_BOT_TOKEN}
- TELEGRAM_API_ID=${TELEGRAM_API_ID}
- TELEGRAM_API_HASH=${TELEGRAM_API_HASH}
- SENTRY_DSN=${SENTRY_DSN}
- TELEGRAM_ADMIN_GROUP_ID=${TELEGRAM_ADMIN_GROUP_ID}
- GROUPHELP_BLOCKLIST_URL=${GROUPHELP_BLOCKLIST_URL}
volumes:
- studunimi-backend_userbot-sessions:/usr/src/app/media/userbot-sessions
depends_on:
- postgres
- django
networks:
- db_net