-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
121 lines (87 loc) · 2.11 KB
/
Copy pathdocker-compose.yml
File metadata and controls
121 lines (87 loc) · 2.11 KB
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
services:
bot:
build:
context: app/bot
dockerfile: Dockerfile
env_file: .env
networks:
- aiogram
stop_signal: SIGINT
depends_on:
- database
- redis
# - caddy # Uncomment if you want to use Caddy as a reverse proxy
restart: always
entrypoint: [ ".venv/bin/python", "main.py" ]
migrations:
# Do not run this container directly. Use `make` to run migrations.
build:
context: app/migrations
dockerfile: Dockerfile
env_file: .env
networks:
- aiogram
stop_signal: SIGINT
volumes:
- ./app/migrations/versions:/app/versions
- ./app/bot/settings.py:/app/settings.py:ro
- ./app/bot/storages/psql:/app/storages/psql:ro
depends_on:
- database
restart: always
database:
image: postgres:18.4
environment:
POSTGRES_USER: $PSQL_USER
POSTGRES_PASSWORD_FILE: /run/secrets/postgres-passwd
POSTGRES_DB: $PSQL_DB
secrets:
- postgres-passwd
networks:
- aiogram
ports:
- "127.0.0.1:$PSQL_EXTERNAL_PORT:5432"
volumes:
- ./psql/data/18:/var/lib/postgresql/18/docker
- ./psql/db-init-scripts:/docker-entrypoint-initdb.d:ro
restart: always
redis:
image: redis:8.8.0
command:
- --port 6379
- --protected-mode no
- --loglevel notice
- --requirepass $REDIS_PASSWORD
- --maxmemory 256MB
- --save 60 300
- --dir /data
- --dbfilename dump.rdb
- --rdbcompression yes
- --rdbchecksum yes
- --always-show-logo yes
networks:
- aiogram
ports:
- "127.0.0.1:$REDIS_EXTERNAL_PORT:6379"
volumes:
- ./redis/data:/data
restart: always
entrypoint: [ "redis-server" ]
caddy:
image: caddy:2.11.4
networks:
- aiogram
ports:
- "80:80"
- "443:443"
volumes:
- ./caddy/Caddyfile:/etc/caddy/Caddyfile
- ./caddy/data:/data
- ./caddy/config:/config
- ./caddy/public:/usr/share/caddy/
restart: always
networks:
aiogram:
secrets:
postgres-passwd:
environment: PSQL_PASSWORD