-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
45 lines (43 loc) · 1000 Bytes
/
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
services:
app:
build: .
ports:
- "5555:5555"
links:
- pg
depends_on:
pg:
condition: service_healthy
environment:
- PROJECT_NAME=fastapi-arch-tmpl
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=admin
- POSTGRES_HOST=pg
- POSTGRES_PORT=5432
- POSTGRES_DB=app_db
- AUTO_RELOAD=true
- DEBUG=true
command: bash -c "alembic upgrade head && python3 manage.py runserver"
volumes:
- .:/app/
pg:
image: postgres:11.15
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=admin
- POSTGRES_DB=app_db
- PGDATA=/var/lib/postgresql/data/pgdata
ports:
- "5432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U admin -d app_db" ]
interval: 5s
timeout: 5s
retries: 5
pgadmin:
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: admin@admin.com
PGADMIN_DEFAULT_PASSWORD: root
ports:
- "5050:80"