-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
98 lines (93 loc) · 3.21 KB
/
Copy pathdocker-compose.yml
File metadata and controls
98 lines (93 loc) · 3.21 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Host-side ports are overridable via .env (container ports stay fixed) so a
# second stack with the same defaults (e.g. rtheatflow) can run in parallel:
# NETZSIM_HOST_PORT=8010 UI_HOST_PORT=8090 INFLUX_HOST_PORT=8096 GRAFANA_HOST_PORT=3010
# Cross-service URLs below use the compose-internal network and never change.
services:
# --- Realtime power-flow simulation (app 1) ---------------------------- #
netzsim:
build: .
ports:
- "${NETZSIM_HOST_PORT:-8000}:8000"
environment:
NETZSIM_DATA_DIR: /app/data
# inside the container the API must be reachable from the other services
NETZSIM_HOST: 0.0.0.0
NETZSIM_STEP_INTERVAL_SECONDS: "1.0"
NETZSIM_STEPS_PER_DAY: "1440"
NETZSIM_AUTOSTART: "true"
NETZSIM_WARM_START: "true"
NETZSIM_LOG_LEVEL: info
# Grid catalog (served by /grids) + cached LPG load library (/loadgen).
# The grid dataset is a committed snapshot under ./data (see data/DATASET.md),
# produced by the separate `gridgen` project.
NETZSIM_LPG_LIBRARY_DIR: /app/data/lpg_library
NETZSIM_CORS_ORIGINS: "*"
volumes:
# Mount your own dataset to override the bundled sample data:
- ./data:/app/data
restart: unless-stopped
# --- Interactive UI (React/Vite served by nginx) ---------------------- #
ui:
build: ./ui
ports:
- "${UI_HOST_PORT:-8080}:80"
depends_on:
- netzsim
restart: unless-stopped
# --- Time-series database --------------------------------------------- #
influxdb:
image: influxdb:2.7
ports:
- "${INFLUX_HOST_PORT:-8086}:8086"
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: admin
DOCKER_INFLUXDB_INIT_PASSWORD: netzsim-admin
DOCKER_INFLUXDB_INIT_ORG: netzsim
DOCKER_INFLUXDB_INIT_BUCKET: powerflow
DOCKER_INFLUXDB_INIT_RETENTION: 7d
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: netzsim-dev-token
volumes:
- influxdb-data:/var/lib/influxdb2
healthcheck:
test: ["CMD", "influx", "ping"]
interval: 5s
timeout: 3s
retries: 20
restart: unless-stopped
# --- Collector: REST -> InfluxDB (app 2, part a) ---------------------- #
collector:
build: ./visualization/collector
depends_on:
influxdb:
condition: service_healthy
netzsim:
condition: service_started
environment:
NETZSIM_URL: http://netzsim:8000
INFLUX_URL: http://influxdb:8086
INFLUX_TOKEN: netzsim-dev-token
INFLUX_ORG: netzsim
INFLUX_BUCKET: powerflow
POLL_INTERVAL_SECONDS: "0.5"
restart: unless-stopped
# --- Grafana dashboard (app 2, part b) -------------------------------- #
grafana:
image: grafana/grafana:11.1.0
ports:
- "${GRAFANA_HOST_PORT:-3000}:3000"
depends_on:
influxdb:
condition: service_healthy
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: admin
GF_USERS_ALLOW_SIGN_UP: "false"
volumes:
- ./visualization/grafana/provisioning:/etc/grafana/provisioning
- ./visualization/grafana/dashboards:/var/lib/grafana/dashboards
- grafana-data:/var/lib/grafana
restart: unless-stopped
volumes:
influxdb-data:
grafana-data: