-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathdocker-compose.yml
81 lines (76 loc) · 1.7 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
services:
db:
image: 'postgres:latest'
container_name: postgres_theater
env_file:
- .env
ports:
- "5432:5432"
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- postgres_theater_data:/var/lib/postgresql/data/
networks:
- theater_network
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U $POSTGRES_USER -d $POSTGRES_DB -h 127.0.0.1 || exit 1" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
pgadmin:
image: dpage/pgadmin4
container_name: pgadmin_theater
ports:
- "3333:80"
env_file:
- .env
depends_on:
db:
condition: service_healthy
volumes:
- pgadmin_theater_data:/var/lib/pgadmin
networks:
- theater_network
web:
restart: always
build: .
container_name: backend_theater
command: [ "/bin/bash", "/commands/run_web_server_dev.sh" ]
env_file:
- .env
environment:
- LOG_LEVEL=debug
- PYTHONPATH=/usr/src/fastapi
- WATCHFILES_FORCE_POLLING=true
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
volumes:
- ./src:/usr/src/fastapi
networks:
- theater_network
migrator:
build: .
container_name: alembic_migrator_theater
command: ["/bin/bash", "/commands/run_migration.sh"]
depends_on:
db:
condition: service_healthy
volumes:
- ./src:/usr/src/fastapi
env_file:
- .env
environment:
- PYTHONPATH=/usr/src/fastapi
networks:
- theater_network
volumes:
postgres_theater_data:
driver: local
pgadmin_theater_data:
driver: local
networks:
theater_network:
driver: bridge