-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
41 lines (36 loc) · 800 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
41 lines (36 loc) · 800 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
41
version: "3.9"
services:
db:
image: postgres:15
command: postgres -c 'max_connections=300'
restart: always
env_file:
- .env
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
interval: 5s
timeout: 5s
retries: 5
app:
build: .
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4
depends_on:
db:
condition: service_healthy
env_file:
- .env
environment:
DB_HOST: db
DB_PORT: 5432
ports:
- "8000:8000"
volumes:
postgres_data: