forked from bytecodealliance/registry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.postgres.yaml
52 lines (52 loc) · 1.59 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
49
50
51
52
# PostgreSQL-enabled configuration override for the registry service
services:
db:
# NOTE: Note as of 2023-04-26 not all IaaS supports v15 for managed SQL
image: postgres:14
restart: always
environment:
POSTGRES_DB: warg_registry
POSTGRES_USER: postgres
POSTGRES_PASSWORD_FILE: /var/secrets/warg/data-store/postgres/password
ports:
- "${WARG_POSTGRES_LISTEN_ADDRESS?e.g., 127.0.0.1:17514}:5432"
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "warg_registry", "-U", "postgres" ]
interval: 1s
timeout: 1s
retries: 30
volumes:
- warg-secrets:/var/secrets/warg:ro
- postgres-data:/var/lib/postgresql/data:rw
networks:
- infra
depends_on:
import-secrets:
condition: service_completed_successfully
warg-registry-db-migration:
build:
target: warg-postgres-migration
depends_on:
db:
condition: service_healthy
import-secrets:
condition: service_completed_successfully
env_file:
- ./infra/local/.secrets/data-store/postgres/database_url_env
networks:
- infra
warg-registry:
depends_on:
import-secrets:
condition: service_completed_successfully
warg-registry-db-migration:
condition: service_completed_successfully
# Database config using cli args because base config already set from base environment.
# NOTE: Test for cli args support.
command:
- --data-store
- postgres
- --database-url-file
- /var/secrets/warg/data-store/postgres/database_url
volumes:
postgres-data: