-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
72 lines (69 loc) · 2.63 KB
/
Copy pathdocker-compose.yml
File metadata and controls
72 lines (69 loc) · 2.63 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
# ── Development stack ────────────────────────────────────────────────────
# Usage: docker compose up -d
#
# This compose file is for local development only. It:
# - builds from the `dev` Dockerfile stage (includes tsx watch + dev deps)
# - bind-mounts ./src for hot reload
# - starts a PostgreSQL container for indicator storage
# - expects OpenMRS to be reachable (defaults to host.docker.internal)
#
# For production deployment, use the Dockerfile directly (default stage)
# and provide environment variables for your production databases.
services:
indicators-back:
build:
context: .
target: dev
container_name: indicators-back
restart: unless-stopped
depends_on:
indicators-postgres:
condition: service_healthy
environment:
PORT: 8000
CORS_ORIGINS: http://localhost:5173,http://127.0.0.1:5173,http://localhost:8080,http://127.0.0.1:8080
INDICATORS_DB_HOST: indicators-postgres
INDICATORS_DB_PORT: 5432
INDICATORS_DB_NAME: ${INDICATORS_DB_NAME:-indicators}
INDICATORS_DB_USER: ${INDICATORS_DB_USER:-postgres}
INDICATORS_DB_PASSWORD: ${INDICATORS_DB_PASSWORD:-postgres}
OPENMRS_DB_HOST: ${OPENMRS_DB_HOST:-host.docker.internal}
OPENMRS_DB_PORT: ${OPENMRS_DB_PORT:-3306}
OPENMRS_DB_NAME: ${OPENMRS_DB_NAME:-openmrs}
OPENMRS_DB_USER: ${OPENMRS_DB_USER:-openmrs}
OPENMRS_DB_PASSWORD: ${OPENMRS_DB_PASSWORD:-openmrs}
OPENMRS_API_URL: ${OPENMRS_API_URL:-http://host.docker.internal/openmrs}
OPENMRS_API_USER: ${OPENMRS_API_USER:-admin}
OPENMRS_API_PASSWORD: ${OPENMRS_API_PASSWORD:-Admin123}
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "8000:8000"
volumes:
- ./src:/app/src:ro
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8000/health"]
interval: 30s
timeout: 5s
retries: 5
start_period: 20s
indicators-postgres:
image: postgres:17
container_name: indicators-postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${INDICATORS_DB_NAME:-indicators}
POSTGRES_USER: ${INDICATORS_DB_USER:-postgres}
POSTGRES_PASSWORD: ${INDICATORS_DB_PASSWORD:-postgres}
ports:
- "5433:5432"
volumes:
- indicators-postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${INDICATORS_DB_USER:-postgres} -d ${INDICATORS_DB_NAME:-indicators}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
volumes:
indicators-postgres-data: