-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
74 lines (70 loc) · 2.54 KB
/
Copy pathdocker-compose.yml
File metadata and controls
74 lines (70 loc) · 2.54 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
# Local development infrastructure for Code Spire (P1 split: Postgres +
# Redpanda; Keycloak/MinIO arrive with P2). Copy .env.example -> .env first.
# Host ports live in the 34xxx project range.
name: spire-dev
services:
redpanda:
image: redpandadata/redpanda:v26.1.12
container_name: spire-redpanda
command:
- redpanda
- start
- --overprovisioned
- --smp=1
- --memory=512M
- --reserve-memory=0M
- --node-id=0
- --check=false
# Dual listener so BOTH run modes reach the broker:
# - EXTERNAL: host quarkusDev connects to localhost:${KAFKA_PORT} (published).
# - INTERNAL: containerised dev services (docker-compose.dev.yml) connect to
# redpanda:9092 on the compose network. A client is handed back the
# advertised address of the listener it bootstrapped through, so each mode
# needs its own advertised host.
- --kafka-addr=INTERNAL://0.0.0.0:9092,EXTERNAL://0.0.0.0:19092
- --advertise-kafka-addr=INTERNAL://redpanda:9092,EXTERNAL://localhost:${KAFKA_PORT:-34092}
ports:
- "${KAFKA_PORT:-34092}:19092"
volumes:
- spire-redpanda:/var/lib/redpanda/data
healthcheck:
test: ["CMD-SHELL", "rpk cluster health --exit-when-healthy || exit 1"]
interval: 10s
timeout: 5s
retries: 6
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
postgres:
image: postgres:18.4-alpine
container_name: spire-postgres
environment:
POSTGRES_DB: ${POSTGRES_DB:?set in .env}
POSTGRES_USER: ${POSTGRES_USER:?set in .env}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set in .env}
# Used only by the init script below to provision the schema-scoped gateway role.
GATEWAY_POSTGRES_USER: ${GATEWAY_POSTGRES_USER:?set in .env}
GATEWAY_POSTGRES_PASSWORD: ${GATEWAY_POSTGRES_PASSWORD:?set in .env}
ports:
- "${POSTGRES_PORT:-34432}:5432"
volumes:
# postgres:18+ convention: mount the PARENT dir (data lives in a
# versioned subdirectory, enabling in-place pg_upgrade --link)
- spire-pgdata:/var/lib/postgresql
# Runs once on a fresh volume: creates the scoped `gateway` role + schema.
- ./infra/postgres-init:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 10s
timeout: 3s
retries: 5
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
volumes:
spire-pgdata:
spire-redpanda: