-
Notifications
You must be signed in to change notification settings - Fork 71
/
docker-compose.yml
38 lines (38 loc) · 948 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
services:
web:
build: .
command: bash -c "alembic upgrade head && uvicorn main:app --host 0.0.0.0 --port 8080 --workers 1 --reload"
volumes:
- ./app/:/app/
- /app/.venv
ports:
- 8080:8080
depends_on:
db:
condition: service_healthy
privileged: true
cap_add:
- SYS_ADMIN
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=password
- POSTGRES_SERVER=db
- POSTGRES_PORT=5432
- POSTGRES_DB=restaurant
db:
image: postgres:15.4-alpine
volumes:
- pg_volume:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=password
- POSTGRES_DB=restaurant
- PGDATA=/var/lib/postgresql/data/pgdata
healthcheck:
test: ["CMD", "sh", "-c", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 5s
start_period: 5s
expose:
- 5432
volumes:
pg_volume: