From 044ffd34e2fac5621b5d7d40fc33e875cc95f080 Mon Sep 17 00:00:00 2001 From: you Date: Mon, 23 Mar 2026 04:43:04 +0000 Subject: [PATCH] fix: config.json lives in /app/data/ volume, not baked into image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - entrypoint copies example config to /app/data/config.json on first run - symlinks /app/config.json → /app/data/config.json so app code unchanged - theme.json also symlinked from /app/data/ if present - config persists across container rebuilds without extra bind mounts - updated README with new config/theme instructions --- README.md | 19 +++++++++++++++++-- docker/entrypoint.sh | 16 ++++++++++++---- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3d3819b..8fbe5f5 100644 --- a/README.md +++ b/README.md @@ -120,11 +120,26 @@ docker run -d \ -p 3000:3000 \ -p 1883:1883 \ -v meshcore-data:/app/data \ - -v $(pwd)/config.json:/app/config.json \ meshcore-analyzer ``` -**Persist your database** across container rebuilds by using a named volume (`meshcore-data`) or bind mount (`-v ./data:/app/data`). +Config lives in the data volume at `/app/data/config.json` — a default is created on first run. To edit it: +```bash +docker exec -it meshcore-analyzer vi /app/data/config.json +``` + +Or use a bind mount for the data directory: +```bash +docker run -d \ + --name meshcore-analyzer \ + -p 3000:3000 \ + -p 1883:1883 \ + -v ./data:/app/data \ + meshcore-analyzer +# Now edit ./data/config.json directly on the host +``` + +**Theme customization:** Drop a `theme.json` in the same data directory (`/app/data/theme.json`) to override default colors, branding, and node/packet type colors for all users. Use the built-in customizer (Tools → Customize) to design your theme and download the file. ### Manual Install diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index cab751e..11f9d44 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,9 +1,17 @@ #!/bin/sh -# Copy example config if no config.json exists -if [ ! -f /app/config.json ]; then - echo "[entrypoint] No config.json found, copying from config.example.json" - cp /app/config.example.json /app/config.json +# Copy example config if no config.json exists (check volume mount first) +if [ ! -f /app/data/config.json ]; then + echo "[entrypoint] No config.json found in /app/data/, copying example" + cp /app/config.example.json /app/data/config.json +fi + +# Symlink so the app finds it at /app/config.json +ln -sf /app/data/config.json /app/config.json + +# Same for theme.json (optional) +if [ -f /app/data/theme.json ]; then + ln -sf /app/data/theme.json /app/theme.json fi exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf