-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml.jinja
61 lines (57 loc) · 1.73 KB
/
docker-compose.yml.jinja
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
version: "3.8"
services:
{{bot_project_name}}:
build: .
container_name: {{bot_project_name}}
environment: &environment
- BOT_CREDENTIALS=$BOT_CREDENTIALS # cts_host@secret_key@bot_id
- POSTGRES_DSN=postgres://postgres:postgres@{{bot_project_name}}-postgres/{{bot_name_underscored}}_db
- REDIS_DSN=redis://{{bot_project_name}}-redis/0
- DEBUG=true
- SMARTLOG_DEBUG_HUIDS=$SMARTLOG_DEBUG_HUIDS
ports:
- "8000:8000" # Отредактируйте порт хоста (первый), если он уже занят
restart: always
depends_on: &depends_on
- postgres
- redis
logging: &logging
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
ulimits: &ulimits
nproc: 65535
nofile:
soft: 20000
hard: 40000
{% if add_worker -%}
{{bot_project_name}}-worker:
build: .
container_name: {{bot_project_name}}-worker
# '$$' prevents docker-compose from interpolating a value
command: /bin/sh -c 'PYTHONPATH="$$PYTHONPATH:$$PWD" saq app.worker.worker.settings'
environment: *environment
restart: always
depends_on: *depends_on
logging: *logging
ulimits: *ulimits
{% endif -%}
postgres:
image: postgres:15.3-alpine
container_name: {{bot_project_name}}-postgres
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB={{bot_name_underscored}}_db
restart: always
volumes:
- ./.storages/postgresdata:/var/lib/postgresql/data
logging: *logging
redis:
image: redis:7.0-alpine
container_name: {{bot_project_name}}-redis
restart: always
volumes:
- ./.storages/redisdata:/data
logging: *logging