Files
NODEDC_MISSION_CORE/deploy/telemetry-plane/compose.yaml
T

110 lines
2.9 KiB
YAML

name: ndc-mission-core-telemetry
x-ndc-labels: &ndc-labels
com.nodedc.product: mission-core
com.nodedc.stack: ndc-mission-core-telemetry
com.nodedc.managed-by: docker-compose
services:
broker:
image: eclipse-mosquitto:2.1.2-alpine
container_name: ndc-mission-core-mqtt-broker
restart: unless-stopped
logging:
driver: local
options:
max-size: "5m"
max-file: "2"
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
cap_add:
- CHOWN
- SETGID
- SETUID
mem_limit: 128m
pids_limit: 128
labels:
<<: *ndc-labels
com.nodedc.role: mqtt-broker
ports:
- "${MISSIONCORE_MQTT_BIND_ADDRESS:-127.0.0.1}:${MISSIONCORE_MQTT_PORT:-1883}:1883"
environment:
MISSIONCORE_MQTT_HEALTH_USER: "${MISSIONCORE_MQTT_INGEST_USER}"
MISSIONCORE_MQTT_HEALTH_PASSWORD: "${MISSIONCORE_MQTT_INGEST_PASSWORD}"
volumes:
- ./mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf:ro
- ./runtime/mosquitto/passwords:/mosquitto/config/passwords:ro
- ./runtime/mosquitto/acl:/mosquitto/config/acl:ro
tmpfs:
- /tmp:size=16m,noexec,nosuid
- /mosquitto/data:size=1m,noexec,nosuid
- /mosquitto/log:size=1m,noexec,nosuid
healthcheck:
test:
- CMD-SHELL
- >-
mosquitto_sub -h 127.0.0.1 -t '$$SYS/broker/uptime' -C 1 -W 3
-u "$$MISSIONCORE_MQTT_HEALTH_USER"
-P "$$MISSIONCORE_MQTT_HEALTH_PASSWORD"
interval: 10s
timeout: 4s
retries: 6
normalizer:
image: ndc-mission-core-telemetry-normalizer:live-v1
container_name: ndc-mission-core-telemetry-normalizer
build:
context: ./normalizer
dockerfile: Dockerfile
restart: unless-stopped
logging:
driver: local
options:
max-size: "5m"
max-file: "2"
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
mem_limit: 256m
pids_limit: 128
labels:
<<: *ndc-labels
com.nodedc.role: telemetry-normalizer
depends_on:
broker:
condition: service_healthy
ports:
- "127.0.0.1:${MISSIONCORE_TELEMETRY_QUERY_PORT:-18030}:18030"
environment:
MISSIONCORE_MQTT_HOST: broker
MISSIONCORE_MQTT_PORT: "1883"
MISSIONCORE_MQTT_USERNAME: "${MISSIONCORE_MQTT_INGEST_USER}"
MISSIONCORE_MQTT_PASSWORD: "${MISSIONCORE_MQTT_INGEST_PASSWORD}"
MISSIONCORE_QUERY_HOST: "0.0.0.0"
MISSIONCORE_QUERY_PORT: "18030"
tmpfs:
- /tmp:size=32m,noexec,nosuid
healthcheck:
test:
- CMD
- python
- -c
- >-
import urllib.request;
urllib.request.urlopen('http://127.0.0.1:18030/health', timeout=3).read()
interval: 10s
timeout: 4s
retries: 6
networks:
default:
name: ndc-mission-core-telemetry
labels:
<<: *ndc-labels
com.nodedc.role: telemetry-network