fix: Make container port match FLASK_PORT for custom port configurations

Previously, the internal container port was hardcoded to 5000, so setting
FLASK_PORT to a different value would break the port mapping and healthcheck.

Credit: Tymo3

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2026-02-23 08:01:12 +01:00
parent 2f82c589c7
commit 000c4f6884

View File

@@ -37,7 +37,7 @@ services:
container_name: mc-webui
restart: unless-stopped
ports:
- "${FLASK_PORT:-5000}:5000"
- "${FLASK_PORT:-5000}:${FLASK_PORT:-5000}"
volumes:
- "${MC_CONFIG_DIR}:/root/.config/meshcore:rw"
- "${MC_ARCHIVE_DIR:-./archive}:/root/.archive/meshcore:rw"
@@ -60,7 +60,7 @@ services:
networks:
- meshcore-net
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5000/api/status')"]
test: ["CMD", "python", "-c", "import urllib.request, os; urllib.request.urlopen(f'http://localhost:{os.environ.get(\"FLASK_PORT\", \"5000\")}/api/status')"]
interval: 30s
timeout: 10s
retries: 3