-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
55 lines (52 loc) · 1.94 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
services:
web:
image: nginx:1.25.5-alpine
ports:
- 80:80
depends_on:
- backend
volumes:
- ./.config/nginx/nginx.conf:/etc/nginx/nginx.conf
backend:
container_name: backend
restart: on-failure
build: .
command: fastapi run src/zametka/main/web.py --root-path=/api/
env_file:
- /usr/local/etc/zametka/.env.access_service
- /usr/local/etc/zametka/.env
- /usr/local/etc/zametka/.env.notes
volumes:
- ./src/zametka/access_service/infrastructure/persistence/alembic/migrations/versions:/home/app/backend/src/zametka/access_service/infrastructure/persistence/alembic/migrations/versions
- ./src/zametka/notes/infrastructure/persistence/alembic/migrations/versions:/home/app/backend/src/zametka/notes/infrastructure/persistence/alembic/migrations/versions
- ./.config/dev.config.toml:/usr/local/etc/zametka/cfg.toml
depends_on:
- migration
db:
container_name: persistence
image: zametkaru/postgres-multi-db
volumes:
- pg_data:/var/lib/postgresql/data/
env_file:
- /usr/local/etc/zametka/.env
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d access_database -U $${POSTGRES_USER}",
"CMD-SHELL", "pg_isready -d notes_database -U $${POSTGRES_USER}" ]
interval: 2s
timeout: 60s
retries: 10
start_period: 3s
migration:
container_name: migration
build: .
restart: on-failure
env_file:
- /usr/local/etc/zametka/.env.access_service
- /usr/local/etc/zametka/.env
- /usr/local/etc/zametka/.env.notes
depends_on:
db:
condition: service_healthy
command: [ "zametka", "all", "alembic", "upgrade", "head" ]
volumes:
pg_data: