From 616763c60374781472f034a238c23ca99ea18daa Mon Sep 17 00:00:00 2001 From: Marius Mutu Date: Thu, 4 Sep 2025 18:00:08 +0300 Subject: [PATCH] Configure flexible deployment with environment variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change Flask port from 8080 to 5000 for consistency - Add environment-based network mode configuration (bridge/host) - Support both Windows Docker Desktop and Linux LXC deployments - Remove obsolete docker-compose version and conflicting network settings - Add .env.example with platform-specific configuration guidance 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .env.example | 20 ++++++++++++++++++++ app/app.py | 2 +- docker-compose.yml | 15 +++------------ 3 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..1f4b346 --- /dev/null +++ b/.env.example @@ -0,0 +1,20 @@ +# WOL Manager Environment Configuration + +# Network mode configuration +# For Windows/macOS Docker Desktop: use "bridge" +# For Linux/LXC/Proxmox: use "host" for guaranteed WOL functionality +WOL_NETWORK_MODE=bridge + +# External port mapping (only used with bridge mode) +# For Windows/macOS: set the external port you want to access +# For Linux with host mode: this setting is ignored +WOL_EXTERNAL_PORT=5000 + +# Examples: +# Windows Docker Desktop: +# WOL_NETWORK_MODE=bridge +# WOL_EXTERNAL_PORT=5000 + +# Linux LXC/Proxmox: +# WOL_NETWORK_MODE=host +# WOL_EXTERNAL_PORT=5000 # ignored in host mode \ No newline at end of file diff --git a/app/app.py b/app/app.py index 86b4995..3d820c2 100644 --- a/app/app.py +++ b/app/app.py @@ -197,4 +197,4 @@ def scan_network(): return jsonify(result) if __name__ == '__main__': - app.run(host='0.0.0.0', port=8080, debug=False) \ No newline at end of file + app.run(host='0.0.0.0', port=5000, debug=False) \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index f93f1da..593dbb8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,25 +1,16 @@ -version: '3.8' - services: wol-web: build: . container_name: wol-manager restart: unless-stopped ports: - - "8088:8080" + - "${WOL_EXTERNAL_PORT:-5000}:5000" volumes: - ./data:/data - networks: - - wol-network environment: - PYTHONUNBUFFERED=1 - # Necesare pentru Wake-on-LAN - network_mode: host + network_mode: "${WOL_NETWORK_MODE:-bridge}" privileged: true cap_add: - NET_ADMIN - - NET_RAW - -networks: - wol-network: - driver: bridge \ No newline at end of file + - NET_RAW \ No newline at end of file