Files
mc-webui/docker-compose.image.yml
MarekWoandClaude Opus 5 f82ee981b2 fix(docker): ship the compose file for image installs so HTTPS works there too
The optional HTTPS proxy is defined in the repo's docker-compose.yml behind the
"https" Compose profile, which only git-checkout installs have. Docker Hub /
GHCR installs write their own compose file from a README heredoc that had no
npm service, so COMPOSE_PROFILES=https matched nothing and started the app
alone - exit 0, no warning. The same gap swallowed MC_TRUST_PROXY,
MC_BIND_ADDRESS and MC_DEMO*, which the compose file passes to the app.

Add docker-compose.image.yml - the image-based counterpart of
docker-compose.yml, maintained here and downloaded instead of hand-copied, so
the npm service and every variable stay in sync. The image tag becomes
MC_IMAGE in .env so the file itself needs no editing and can be re-downloaded
when something is added to it.

Docs: README Option A downloads the file (and .env.example) instead of pasting
one, and switches tags via MC_IMAGE; https-setup.md Step 1 splits into the two
install paths, tells image installs to refresh the file, notes that
MC_TRUST_PROXY / MC_BIND_ADDRESS need it too, adds the curl for
npm-default-site.conf (no docker/ folder there) and a troubleshooting row for
"only mc-webui starts, no error".

Verified with `docker compose config` in a scratch project directory: the old
hand-written file plus COMPOSE_PROFILES=https in .env resolves to mc-webui
only, the new file to mc-webui + npm with MC_TRUST_PROXY passed and port 5000
bound to 127.0.0.1; `config --images` lists both images, so update-image.sh
pulls and recreates them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-12 18:18:36 +02:00

89 lines
3.6 KiB
YAML

# mc-webui — Docker Hub / GHCR installation (README "Option A")
#
# The counterpart of docker-compose.yml for installations that never cloned the
# repository: the same services, but the app comes from the published image
# instead of a local build. Download it as your docker-compose.yml:
#
# curl -fsSL https://raw.githubusercontent.com/MarekWo/mc-webui/main/docker-compose.image.yml \
# -o docker-compose.yml
#
# Keep it unedited. Everything configurable is a variable read from .env, so the
# file can be downloaded again at any time — to pick up services added later,
# such as the optional HTTPS proxy at the bottom — without losing your setup.
services:
mc-webui:
# Stable release: mawoj/mc-webui:latest — development: mawoj/mc-webui:dev
# GHCR mirror: ghcr.io/marekwo/mc-webui. Switch with MC_IMAGE in .env.
image: ${MC_IMAGE:-mawoj/mc-webui:latest}
container_name: mc-webui
restart: unless-stopped
# MC_BIND_ADDRESS=127.0.0.1 keeps the plain-HTTP port off the network once
# HTTPS is up (docs/https-setup.md). Default 0.0.0.0 = reachable as before.
ports:
- "${MC_BIND_ADDRESS:-0.0.0.0}:${FLASK_PORT:-5000}:${FLASK_PORT:-5000}"
# Grant access to serial devices for auto-detection
# Major 188 = ttyUSB (CP2102, CH340), Major 166 = ttyACM (ESP32-S3)
device_cgroup_rules:
- 'c 188:* rmw'
- 'c 166:* rmw'
# NET_ADMIN + NET_RAW for BLE scanning (no overhead when BLE unused)
cap_add:
- NET_ADMIN
- NET_RAW
volumes:
- "${MC_CONFIG_DIR:-./data}:/data:rw"
- "/dev:/dev"
- "/var/run/dbus:/var/run/dbus" # BlueZ D-Bus (for BLE)
environment:
- MC_SERIAL_PORT=${MC_SERIAL_PORT:-auto}
- MC_DEVICE_NAME=${MC_DEVICE_NAME:-MeshCore}
- MC_CONFIG_DIR=/data
- MC_TCP_HOST=${MC_TCP_HOST:-}
- MC_TCP_PORT=${MC_TCP_PORT:-5555}
- MC_BLE_ADDRESS=${MC_BLE_ADDRESS:-}
- MC_BACKUP_ENABLED=${MC_BACKUP_ENABLED:-true}
- MC_BACKUP_HOUR=${MC_BACKUP_HOUR:-2}
- MC_BACKUP_RETENTION_DAYS=${MC_BACKUP_RETENTION_DAYS:-7}
- FLASK_HOST=${FLASK_HOST:-0.0.0.0}
- FLASK_PORT=${FLASK_PORT:-5000}
- FLASK_DEBUG=${FLASK_DEBUG:-false}
- MC_TRUST_PROXY=${MC_TRUST_PROXY:-false}
- MC_DEMO=${MC_DEMO:-false}
- MC_DEMO_TRUSTED_NETS=${MC_DEMO_TRUSTED_NETS:-}
- MC_DEMO_UNLOCK_CODE=${MC_DEMO_UNLOCK_CODE:-}
- TZ=${TZ:-UTC}
env_file:
- path: .env
required: false
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
# Optional HTTPS front end — Nginx Proxy Manager.
# Inert unless the "https" profile is active, so existing installs are untouched.
# Enable it by putting COMPOSE_PROFILES=https in .env, then run the usual
# `docker compose up -d`. Full guide: docs/https-setup.md
#
# Both services share this project's default network, so the proxy reaches the
# app at http://mc-webui:5000 without the app publishing any port at all.
npm:
image: ${NPM_IMAGE:-jc21/nginx-proxy-manager:latest}
container_name: mc-webui-proxy
profiles: ["https"]
restart: unless-stopped
depends_on:
- mc-webui
ports:
- "${NPM_HTTP_PORT:-80}:80" # HTTP — also the Let's Encrypt HTTP-01 challenge
- "${NPM_HTTPS_PORT:-443}:443" # HTTPS
- "${NPM_ADMIN_PORT:-81}:81" # Proxy Manager admin UI
volumes:
- "${NPM_DATA_DIR:-./data/npm}:/data"
- "${NPM_LETSENCRYPT_DIR:-./data/letsencrypt}:/etc/letsencrypt"
environment:
- TZ=${TZ:-UTC}
- DISABLE_IPV6=${NPM_DISABLE_IPV6:-true}