-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
40 lines (38 loc) · 935 Bytes
/
docker-compose.yml
File metadata and controls
40 lines (38 loc) · 935 Bytes
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
services:
web:
build: .
ports:
- "8001:8000"
volumes:
- .:/app
environment:
- PYTHONUNBUFFERED=1
- DB_HOST=db
- DB_PORT=5432
- DB_NAME=exchange_db
- DB_USER=postgres
- DB_PASS=postgres_password
depends_on:
db:
condition: service_healthy
command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
db:
image: postgres:15-alpine
container_name: exchange_postgres
environment:
- POSTGRES_DB=exchange_db
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres_password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
volumes:
postgres_data: