generated from bomzheg/aiogram_template
-
Notifications
You must be signed in to change notification settings - Fork 10
/
docker-compose.yml
138 lines (126 loc) · 3.02 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
version: '3.2'
services:
shvatka:
container_name: "shvatka-${ENV_NAME}"
restart: always
image: "bomzheg/shvatka:${SHVATKA_VERSION:-latest}"
volumes:
- type: "bind"
source: "./config/"
target: "/code/shvatka/config/"
read_only: true
- type: "bind"
source: "./files/"
target: "/files/"
networks:
- reverse-proxy
- botapi
- redis
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "127.0.0.1:${EXPOSED_PORT:-8001}:8000"
entrypoint:
["python", "-m", "shvatka"]
deploy:
resources:
reservations:
memory: 250M
cpus: "0.008"
limits:
memory: 800M
cpus: "0.15"
shvatka-ui:
container_name: "shvatka_ui-${ENV_NAME}"
restart: always
image: bomzheg/shvatka-ui:${SHVATKA_UI_VERSION:-latest}
networks:
- reverse-proxy
env_file:
- "config/ui.env"
deploy:
resources:
reservations:
memory: 5M
limits:
memory: 80M
cpus: "0.01"
migrations:
profiles:
- "migrate"
restart: "no"
image: "bomzheg/shvatka:${SHVATKA_VERSION:-latest}"
volumes:
- type: "bind"
source: "./config/"
target: "/code/shvatka/config/"
read_only: true
- type: "bind"
source: "./alembic.ini"
target: "/code/shvatka/alembic.ini"
read_only: true
extra_hosts:
- "host.docker.internal:host-gateway"
entrypoint: ["alembic", "upgrade", "head"]
cli:
profiles:
- "cli"
restart: "no"
image: "bomzheg/shvatka:${SHVATKA_VERSION:-latest}"
volumes:
- type: "bind"
source: "./config/"
target: "/code/shvatka/config/"
read_only: true
- type: "bind"
source: "./files/"
target: "/files/"
extra_hosts:
- "host.docker.internal:host-gateway"
entrypoint: ["bash"]
telegram-bot-api:
profiles: [ "botapi" ]
image: "aiogram/telegram-bot-api:${BOTAPI_VERSION:-latest}"
environment:
TELEGRAM_API_ID: "6"
TELEGRAM_API_HASH: "eb06d4abfb49dc3eeb1aeb98ae0f581e"
TELEGRAM_LOCAL: 1
volumes:
- telegram-bot-api-data:/var/lib/telegram-bot-api
networks:
- botapi
nginx:
profiles: [ "botapi" ]
image: "nginx:${NGINX:-latest}"
volumes:
- telegram-bot-api-data:/usr/share/nginx/html/var/lib/telegram-bot-api:ro
environment:
- NGINX_PORT=80
networks:
- botapi
redis-dev:
profiles: [ "dev" ]
image: "redis:${REDIS_VERSION:-6.2.13-alpine}"
entrypoint: redis-server --appendonly yes
volumes:
- redis_data:/data
networks:
- redis
ports:
- "6379:6379"
redis:
image: "redis:${REDIS_VERSION:-6.2.13-alpine}"
entrypoint: redis-server --appendonly yes
volumes:
- redis_data:/data
networks:
- redis
volumes:
telegram-bot-api-data:
redis_data:
networks:
reverse-proxy:
external:
name: nginx-reverse-proxy
redis:
botapi: