generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yaml
executable file
·57 lines (54 loc) · 1.26 KB
/
compose.yaml
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
48
49
50
51
52
53
54
55
56
57
name: civil-case-api
services:
db:
container_name: case-api-db
image: postgres:16
command: ["postgres", "-c", "log_statement=all"]
environment: &database_config
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: case_api
POSTGRES_PORT: 5432
POSTGRES_HOST: db
ports:
- "5436:5432"
healthcheck:
test: pg_isready -U postgres -d case_api
start_period: 5s
start_interval: 0.2s
interval: 30s
timeout: 3s
retries: 3
api:
container_name: case-api
build: .
command: uvicorn app:case_api --host 0.0.0.0 --port 8027 --reload
ports:
- "8027:8027"
environment:
SECRET_KEY: "TEST_KEY"
<<: *database_config
DB_USER: postgres
DB_PASSWORD: postgres
DB_NAME: case_api
DB_PORT: 5432
DB_HOST: db
volumes:
- ./app:/home/app/case_api/app
depends_on:
db:
condition: service_healthy
migrations:
build: .
container_name: db-migrations
command: alembic upgrade head
environment:
<<: *database_config
DB_USER: postgres
DB_PASSWORD: postgres
DB_NAME: case_api
DB_PORT: 5432
DB_HOST: db
depends_on:
db:
condition: service_healthy