-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
47 lines (46 loc) · 1.22 KB
/
docker-compose.yaml
File metadata and controls
47 lines (46 loc) · 1.22 KB
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
47
services:
web:
build:
context: .
env_file: .env
environment:
- DB_CONNECTION=postgresql://postgres:password@db:5432/postgres
- ENV_MODE=local
ports:
- "8000:8000"
volumes:
- .:/app
depends_on:
db:
condition: service_healthy
command: >
sh -c "sleep 5 && uvicorn main:app --host 0.0.0.0 --port 8000 --reload"
db:
image: postgres:16.4-alpine
environment:
POSTGRES_PASSWORD: password
POSTGRES_DB: postgres
ports:
- 5432:5432
volumes:
- postgres_data:/var/lib/postgresql/data
- ./sql/create_tables.sql:/docker-entrypoint-initdb.d/1-create_tables.sql
- ./sql/import_data.sql:/docker-entrypoint-initdb.d/2-import_data.sql
- ./sql/init_test_data.sql:/docker-entrypoint-initdb.d/3-init_test_data.sql
- ./sql/add_secondary_location.sql:/app/sql/add_secondary_location.sql
- ./data:/docker-entrypoint-initdb.d/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
adminer:
image: adminer
restart: always
ports:
- 4040:8080
depends_on:
db:
condition: service_healthy
volumes:
postgres_data: