-
Notifications
You must be signed in to change notification settings - Fork 30
/
docker-compose.postgres.yaml
48 lines (43 loc) · 1.1 KB
/
docker-compose.postgres.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
# PostgreSQL-enabled configuration override for the registry service
name: warg-server
services:
api:
environment:
WARG_DATA_STORE: postgres
WARG_DATABASE_URL: "postgres://warg:${POSTGRES_PASSWORD}@postgres:5432/warg"
depends_on:
migration:
condition: service_completed_successfully
migration:
build:
context: .
target: migration
environment:
DATABASE_URL: "postgres://warg:${POSTGRES_PASSWORD}@postgres:5432/warg"
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: warg
POSTGRES_USER: warg
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "warg", "-U", "warg" ]
start_period: 5s
start_interval: 10s
interval: 10s
timeout: 5s
retries: 5
secrets:
- postgres_password
expose:
- 5432
volumes:
- postgres-data:/var/lib/postgresql/data
secrets:
postgres_password:
environment: "POSTGRES_PASSWORD"
volumes:
postgres-data: