-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathdocker-compose.reporting-stack.yml
More file actions
57 lines (54 loc) · 1.91 KB
/
Copy pathdocker-compose.reporting-stack.yml
File metadata and controls
57 lines (54 loc) · 1.91 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
# =============================================================================
# Reporting Stack Integration Overlay
# =============================================================================
# Configures the OpenLMIS database for CDC and provides a shared network
# for the reporting-stack platform to connect to.
#
# Usage:
# docker compose -f docker-compose.yml -f docker-compose.reporting-stack.yml up -d
#
# This overlay:
# 1. Creates a 'reporting-shared' network (auto-managed by Compose)
# 2. Attaches the DB to it with alias 'olmis-db'
# 3. Runs a one-shot init container that configures the DB for CDC
# =============================================================================
networks:
# Shared network for reporting-stack platform connectivity.
# The reporting-stack's kafka-connect service joins this as external.
# Using explicit 'name' ensures a stable, project-prefix-free network name.
reporting-shared:
name: reporting-shared
driver: bridge
services:
db:
networks:
default:
reporting-shared:
aliases:
- olmis-db
# One-shot container that configures the DB for CDC.
# Must wait for referencedata + requisition to be healthy (Flyway + refresh-db
# complete) — otherwise refresh-db drops/recreates tables AFTER the publication
# is set, silently removing them from CDC.
reporting-stack-init:
image: postgres:14-alpine
depends_on:
db:
condition: service_started
referencedata:
condition: service_healthy
requisition:
condition: service_healthy
networks:
- default
environment:
PGHOST: db
PGPORT: "5432"
PGDATABASE: open_lmis
PGUSER: postgres
PGPASSWORD: p@ssw0rd
volumes:
- ./reporting-stack/init-db.sql:/init-db.sql:ro
- ./reporting-stack/wait-and-init.sh:/wait-and-init.sh:ro
entrypoint: ["bash", "/wait-and-init.sh"]
restart: "no"