-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess-compose.yml
More file actions
83 lines (78 loc) · 2.41 KB
/
Copy pathprocess-compose.yml
File metadata and controls
83 lines (78 loc) · 2.41 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
version: "0.5"
processes:
postgres:
command: |
if [ ! -d "${PG_DATA:-.pg_data}" ]; then
initdb -D "${PG_DATA:-.pg_data}" --auth=trust
fi
exec postgres -D "${PG_DATA:-.pg_data}" -p 5432 -k /tmp
readiness_probe:
exec:
command: pg_isready -h /tmp -p 5432 -d postgres
initial_delay_seconds: 1
period_seconds: 1
shutdown:
signal: 2
postgres-init:
command: |
createdb -h /tmp -p 5432 pba_service 2>/dev/null || true
echo "Database ready"
depends_on:
postgres:
condition: process_healthy
availability:
restart: "no"
keycloak:
# Disabled by default — dev runs with AUTH_ENABLED=false, so no OIDC provider
# is needed. Set this to false (and re-add the keycloak dependency under
# pba-service) to test the Keycloak login flow.
disabled: true
command: |
docker run --rm --name pba-keycloak \
-p 8180:8080 \
-v "$(pwd)/keycloak/realm-export.json:/opt/keycloak/data/import/realm-export.json:ro" \
-e KC_BOOTSTRAP_ADMIN_USERNAME=admin \
-e KC_BOOTSTRAP_ADMIN_PASSWORD=admin \
quay.io/keycloak/keycloak:26.2 \
start-dev --import-realm
readiness_probe:
http_get:
host: 127.0.0.1
port: 8180
path: /realms/pba/.well-known/openid-configuration
initial_delay_seconds: 15
period_seconds: 3
failure_threshold: 20
shutdown:
command: docker rm -f pba-keycloak
tigerbeetle:
command: |
if [ ! -f .tb_data/dev/0_0.tigerbeetle ]; then
mkdir -p .tb_data/dev
tigerbeetle format --cluster=0 --replica=0 --replica-count=1 .tb_data/dev/0_0.tigerbeetle
fi
exec tigerbeetle start --addresses=3000 .tb_data/dev/0_0.tigerbeetle
readiness_probe:
exec:
command: nc -z 127.0.0.1 3000
initial_delay_seconds: 5
period_seconds: 2
failure_threshold: 10
pba-service:
command: cargo run -p pba-service
environment:
# Auto-apply pending migrations in dev (the binary itself defaults to skipping).
- DB_MIGRATION_MODE=run
depends_on:
postgres-init:
condition: process_completed_successfully
tigerbeetle:
condition: process_healthy
readiness_probe:
http_get:
host: 127.0.0.1
port: 3030
path: /health
initial_delay_seconds: 10
period_seconds: 5
failure_threshold: 60