# Compose stack for the motor-vehicle-manufacturing reference architecture. # # Services (in dependency order): # token-bootstrap one-shot: generate the offline admin token + plugin dir # influxdb3 single-node InfluxDB 3 Enterprise (--mode all) # plugin-installer one-shot: install plugins from the public plugin registry # via POST /api/v3/plugins/files (see installer/) # influxdb3-init one-shot: database, tables, LVC, triggers # forecast-init one-shot: heavy chronos/torch package install + trigger # enable, off the critical path so the UI starts fast # ui FastAPI dashboard on :8080 # # There is deliberately NO simulator service and NO plugin bind mount on the # influxdb3 service: data is generated by the signal_generator plugin inside # the Processing Engine, and all plugin code arrives over the API. name: influxdb3-ref-auto-manufacturing services: # One-shot: generate an offline admin token on first boot. The server # needs one via --admin-token-file; the recovery endpoint can only # REGENERATE existing tokens, not create the first one. Also creates # the plugin directory inside the data volume — the server requires # --plugin-dir to exist at startup, and plugins are uploaded into it # later by the plugin-installer service. token-bootstrap: image: influxdb:3-enterprise container_name: auto-token-bootstrap environment: INFLUXDB3_UNSET_VARS: LOG_FILTER INFLUXDB3_LOG_FILTER: info volumes: - influxdb-data:/var/lib/influxdb3 entrypoint: ["sh", "-c"] command: - | mkdir -p /var/lib/influxdb3/plugins if [ -s /var/lib/influxdb3/.auto-operator-token ]; then echo "[bootstrap] admin token already exists, skipping" exit 0 fi echo "[bootstrap] generating offline admin token" influxdb3 create token --admin --offline \ --name auto-admin \ --output-file /var/lib/influxdb3/.auto-operator-token chmod 600 /var/lib/influxdb3/.auto-operator-token echo "[bootstrap] admin token written" restart: "no" influxdb3: image: influxdb:3-enterprise container_name: auto-influxdb3 depends_on: token-bootstrap: condition: service_completed_successfully environment: INFLUXDB3_ENTERPRISE_LICENSE_EMAIL: ${INFLUXDB3_ENTERPRISE_EMAIL:?set INFLUXDB3_ENTERPRISE_EMAIL in .env} INFLUXDB3_ENTERPRISE_LICENSE_TYPE: ${INFLUXDB3_ENTERPRISE_LICENSE_TYPE:-trial} INFLUXDB3_NODE_IDENTIFIER_PREFIX: auto-node INFLUXDB3_OBJECT_STORE: file INFLUXDB3_DATA_DIR: /var/lib/influxdb3 INFLUXDB3_UNSET_VARS: LOG_FILTER INFLUXDB3_LOG_FILTER: info command: > serve --node-id auto-node0 --cluster-id auto --mode all --object-store file --data-dir /var/lib/influxdb3 --plugin-dir /var/lib/influxdb3/plugins --virtual-env-location /var/lib/influxdb3/plugin-venv --admin-token-file /var/lib/influxdb3/.auto-operator-token --admin-token-recovery-http-bind 0.0.0.0:8182 volumes: - influxdb-data:/var/lib/influxdb3 ports: - "8181:8181" healthcheck: test: ["CMD-SHELL", "test -s /var/lib/influxdb3/.auto-token-plain && curl -sf --max-time 2 -H \"Authorization: Bearer $$(cat /var/lib/influxdb3/.auto-token-plain)\" http://127.0.0.1:8181/health -o /dev/null"] interval: 5s timeout: 3s retries: 120 start_period: 5s # One-shot: write the plain-text token for healthchecks, then install # plugins from the plugin registry through the files API. Runs before # the healthcheck can pass (it writes .auto-token-plain), so it gates # on service_started, not service_healthy, and does its own API wait. plugin-installer: build: context: . dockerfile: installer/Dockerfile container_name: auto-plugin-installer depends_on: influxdb3: condition: service_started environment: INFLUX_URL: http://influxdb3:8181 TOKEN_FILE: /tokens/.auto-operator-token TOKEN_PLAIN_FILE: /tokens/.auto-token-plain LOCK_FILE: /installer/plugins.lock LOCAL_PLUGINS_DIR: /local-plugins REGISTRY_INDEX_URL: ${REGISTRY_INDEX_URL:-https://github.com/influxdata/influxdb3_plugins/releases/download/registry/index.json} INSTALLER_OFFLINE_DIR: ${INSTALLER_OFFLINE_DIR:-} volumes: - influxdb-data:/tokens - ./installer:/installer:ro - ./plugins:/local-plugins:ro restart: "no" influxdb3-init: image: influxdb:3-enterprise container_name: auto-influxdb3-init depends_on: influxdb3: condition: service_started plugin-installer: condition: service_completed_successfully environment: INFLUXDB3_UNSET_VARS: LOG_FILTER INFLUXDB3_LOG_FILTER: info ALARM_THRESHOLD_C: ${ALARM_THRESHOLD_C:-44.0} STATIONS: ${STATIONS:-booth-01:paint,weld-01:weld,cnc-01:machining} volumes: - influxdb-data:/var/lib/influxdb3 - ./influxdb/init.sh:/usr/local/bin/auto-init.sh:ro - ./installer/plugins.lock:/installer/plugins.lock:ro entrypoint: ["/usr/local/bin/auto-init.sh"] restart: "no" # One-shot: chronos-forecasting + torch install and forecast-trigger # enable. Deliberately NOT on the ui's dependency path — the package # install can take minutes on first boot, and the raw/clean pipeline # should be visible within the two-minute portfolio target. No-op when # FORECAST_ENABLED=false. forecast-init: image: influxdb:3-enterprise container_name: auto-forecast-init depends_on: influxdb3-init: condition: service_completed_successfully environment: INFLUXDB3_UNSET_VARS: LOG_FILTER INFLUXDB3_LOG_FILTER: info FORECAST_ENABLED: ${FORECAST_ENABLED:-true} STATIONS: ${STATIONS:-booth-01:paint,weld-01:weld,cnc-01:machining} volumes: - influxdb-data:/var/lib/influxdb3 - ./influxdb/init.sh:/usr/local/bin/auto-init.sh:ro - ./installer/plugins.lock:/installer/plugins.lock:ro entrypoint: ["/usr/local/bin/auto-init.sh", "--forecast"] restart: "no" ui: build: context: . dockerfile: ui/Dockerfile container_name: auto-ui depends_on: influxdb3: condition: service_healthy influxdb3-init: condition: service_completed_successfully environment: INFLUX_URL: http://influxdb3:8181 INFLUX_PUBLIC_URL: ${INFLUX_PUBLIC_URL:-http://localhost:8181} INFLUX_DB: auto INFLUX_TOKEN_FILE: /tokens/.auto-operator-token UI_POLL_MS: ${UI_POLL_MS:-1000} ALARM_THRESHOLD_C: ${ALARM_THRESHOLD_C:-44.0} CLEAN_SHIFT_MS: ${CLEAN_SHIFT_MS:--1400} FORECAST_ENABLED: ${FORECAST_ENABLED:-true} STATIONS: ${STATIONS:-booth-01:paint,weld-01:weld,cnc-01:machining} command: ["uvicorn", "ui.app:app", "--host", "0.0.0.0", "--port", "8080"] ports: - "${UI_PORT:-8080}:8080" volumes: - influxdb-data:/tokens:ro volumes: influxdb-data: