-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
50 lines (47 loc) · 1.24 KB
/
Copy pathcompose.yaml
File metadata and controls
50 lines (47 loc) · 1.24 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
48
49
50
services:
postgres:
image: postgres:17-alpine
environment:
POSTGRES_DB: control_plane
POSTGRES_PASSWORD: control_plane
POSTGRES_USER: control_plane
ports:
- "${ACP_POSTGRES_PORT:-5432}:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U control_plane -d control_plane"]
interval: 5s
timeout: 3s
retries: 10
migrate:
build: .
command: ["alembic", "upgrade", "head"]
environment:
ACP_DATABASE_URL: postgresql+psycopg://control_plane:control_plane@postgres:5432/control_plane
depends_on:
postgres:
condition: service_healthy
control-plane:
build: .
environment:
ACP_DATABASE_URL: postgresql+psycopg://control_plane:control_plane@postgres:5432/control_plane
ports:
- "${ACP_HTTP_PORT:-8000}:8000"
depends_on:
migrate:
condition: service_completed_successfully
healthcheck:
test:
- CMD
- python
- -c
- >-
import urllib.request;
urllib.request.urlopen('http://127.0.0.1:8000/health/ready', timeout=2)
interval: 10s
timeout: 3s
retries: 3
start_period: 5s
volumes:
postgres-data: