-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
143 lines (134 loc) · 3.12 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
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
139
140
141
142
143
version: "3.9"
name: "baby_domik"
services:
bot:
profiles: [ "all", "bot", "bot+db" ]
container_name: bot
build:
context: .
image: baby_domik:v1
restart: always
depends_on:
nats:
condition: service_started
postgres:
condition: service_healthy
networks:
- network
environment:
CONFIG_PATH: '/app/config/'
volumes:
- ./config:/app/config:ro
- ./config/settings.py:/app/src/settings/settings.py
- ./src/db/data:/app/src/db/data
- ./src/log/archive:/app/src/log/archive
command: faststream run bot:fast_stream
postgres:
profiles: [ "all", "db", "bot+db", "migration" ]
container_name: postgres
image: "postgres:16"
restart: unless-stopped
volumes:
- db:/var/lib/postgresql/data
env_file:
- config/.env
ports:
- "5432:5432"
networks:
- network
healthcheck:
test: [ "CMD", "pg_isready", "-U", "$POSTGRES_USER", "-d", "$POSTGRES_DB" ]
interval: 10s
timeout: 5s
retries: 5
migration:
profiles: [ "migration" ]
container_name: migration
build:
context: .
dockerfile: Dockerfile-migration
image: mikieremiki/baby_domik_migration
restart: no
depends_on:
postgres:
condition: service_healthy
networks:
- network
volumes:
- ./config:/app/config:ro
- ./src/db:/app/src/db:ro
environment:
- CONFIG_PATH=${CONFIG_PATH:-config/}
working_dir: /app
command: tail -F anything
pgadmin:
profiles: [ "pgadmin" ]
container_name: pgadmin
image: dpage/pgadmin4
restart: no
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: admin
volumes:
- pgadmin:/var/lib/pgadmin
ports:
- "5050:80"
networks:
- network
nats:
profiles: [ "all", "nats", "api" ]
container_name: nats
image: nats:2.10.11-alpine
restart: unless-stopped
ports:
- '6222:6222'
- '8222:8222'
volumes:
- nats:/nats
- ./config/server.conf:/etc/nats/server.conf
networks:
- network
command: 'nats-server -c /etc/nats/server.conf'
nats-cli:
profiles: [ "nats-cli" ]
container_name: nats-cli
image: natsio/nats-box
restart: unless-stopped
networks:
- network
command: [ "tail", "-f", "/dev/null" ]
fastapi:
profiles: [ "all", "fastapi", "api" ]
container_name: fastapi
build:
context: .
dockerfile: Dockerfile-server
image: baby_domik_fastapi:v1
restart: unless-stopped
networks:
- network
depends_on:
- nats
command: [ "python3", "-m", "fastapi_nats", "run" ]
nginx:
profiles: [ "all", "nginx", "api" ]
container_name: nginx
image: nginx:latest
restart: unless-stopped
ports:
- "80:443"
volumes:
- ./config/nginx.conf:/etc/nginx/nginx.conf
- ./config/server.crt:/etc/nginx/server.crt
- ./config/server.key:/etc/nginx/server.key
networks:
- network
depends_on:
- fastapi
volumes:
db:
pgadmin:
nats:
networks:
network:
name: baby_domik