forked from Kpa-clawbot/CoreScope
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.staging.yml
More file actions
106 lines (103 loc) · 4.48 KB
/
Copy pathdocker-compose.staging.yml
File metadata and controls
106 lines (103 loc) · 4.48 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
99
100
101
102
103
104
105
106
# docker-compose.staging.yml — CoreScope's own staging deployment.
#
# AUDIENCE: the CoreScope maintainers deploying to the internal staging VM
# where a standalone `mqtt-broker` container (eclipse-mosquitto:2) has
# already been provisioned out-of-band on the docker network
# `meshcore-net`. The broker owns port 8883 externally; corescope-staging-go
# reaches it in-network at `mqtt-broker:1883` via docker DNS.
#
# If you are a third-party operator running your own single-host CoreScope,
# use `docker-compose.example.yml` (external MQTT / no built-in broker)
# or `docker-compose.no-mosquitto.yml` (self-hosted, external broker).
# The `.no-mosquitto` variants assume you supply the broker; this file
# assumes the broker is already running on a shared external network.
#
# SEMANTIC CHANGE (v3.7+): `DISABLE_MOSQUITTO` here defaults to `true`
# because the standalone broker is authoritative on staging. Third-party
# operators who want the OLD single-container behavior (in-container
# mosquitto + host-published 1883) should override the env AND re-add
# the port mapping — see the concrete snippet inline below.
#
# Override defaults via .env or environment variables.
services:
staging-go:
build:
context: .
dockerfile: Dockerfile
args:
APP_VERSION: ${APP_VERSION:-unknown}
GIT_COMMIT: ${GIT_COMMIT:-unknown}
BUILD_TIME: ${BUILD_TIME:-unknown}
image: corescope-go:latest
container_name: corescope-staging-go
restart: unless-stopped
stop_grace_period: 30s
stop_signal: SIGTERM
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "${STAGING_GO_HTTP_PORT:-80}:80"
# NOTE: host port 1883 is intentionally NOT published here. The
# standalone mqtt-broker container (managed out-of-band on the
# staging VM) owns MQTT and is reachable to staging-go via the
# external "meshcore-net" docker network below. Operators who
# need the legacy in-container mosquitto can re-enable it by
# setting DISABLE_MOSQUITTO=false in the env AND re-adding the
# host port mapping. Copy-paste snippet for the ports: list:
#
# - "${STAGING_GO_MQTT_PORT:-1883}:1883"
#
# (drop it in-between the :80 mapping and the pprof ports below).
- "6060:6060" # pprof server
- "6061:6061" # pprof ingestor
volumes:
- ${STAGING_DATA_DIR:-~/meshcore-staging-data}:/app/data
- caddy-data-staging-go:/data/caddy
environment:
- NODE_ENV=staging
- ENABLE_PPROF=true
# Default TRUE: the standalone mqtt-broker container owns MQTT on
# the staging VM (semantic flip vs. pre-v3.7). Override to false
# only if you intend to run the legacy in-container mosquitto
# instead — and remember to also re-add the 1883 port mapping
# snippet above so external clients can reach it.
- DISABLE_MOSQUITTO=${DISABLE_MOSQUITTO:-true}
- DISABLE_CADDY=${DISABLE_CADDY:-false}
networks:
# Default compose network for intra-stack DNS (unchanged).
default: {}
# External network owned by the standalone mqtt-broker container.
# Joining it lets staging-go's ingestor resolve "mqtt-broker:1883"
# via docker DNS without going through the host.
meshcore-net: {}
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:3000/api/stats"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
# NOTE — DEPLOY PREREQ (HARD REQUIREMENT):
# The `meshcore-net` external network below MUST already exist before
# `docker compose -f docker-compose.staging.yml up` is invoked. It is
# NOT created by this file (it's marked `external: true`) because the
# standalone `mqtt-broker` container is the network's real owner and
# lives outside this repo (operator-managed state). If the network is
# missing, docker compose will refuse to start staging-go.
#
# One-time provisioning on the staging host:
#
# docker network create meshcore-net
#
# Then start the standalone broker on that network (operator state,
# not tracked here), then bring staging-go up. See DEPLOY.md
# ("Standalone MQTT broker (staging)") for the full flow.
networks:
# Pre-existing external network created and owned by the operator-
# managed mqtt-broker container. Declared external so this compose
# file never tries to create or destroy it.
meshcore-net:
external: true
name: meshcore-net
volumes:
# Named volume for Caddy TLS certificates (not user data — managed by Caddy internally)
caddy-data-staging-go: