-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
46 lines (42 loc) · 1.03 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
version: "3"
services:
db:
image: postgres:latest
container_name: postgres
expose:
- "5433" # Publishes 5433 to other containers but NOT to host machine
ports:
- "5433:5432"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5433"]
interval: 30s
timeout: 5s
retries: 5
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=fastapi
command: -p 5433
web:
build: .
container_name: fastapi-web
command: bash -c "alembic upgrade head && uvicorn demo:app --host 0.0.0.0 --port 8000 --reload"
volumes:
- .:/code
environment:
- DATABASE_URL=postgresql+psycopg2://postgres:postgres@db:5433
ports:
- "8000:8000"
restart: always
depends_on:
- db
pgadmin:
container_name: pgadmin
image: dpage/pgadmin4:latest
environment:
- PGADMIN_DEFAULT_EMAIL=pgadmin4@pgadmin.org
- PGADMIN_DEFAULT_PASSWORD=admin
ports:
- "5050:80"
depends_on:
- db