diff --git a/Dockerfile b/Dockerfile index 9e216077..231905af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -100,6 +100,7 @@ ENV NODE_ENV=production ENV PORT=5000 ENV SIGNAL_PORT=21116 ENV HOST=0.0.0.0 +ENV API_HOST=0.0.0.0 ENV DATA_DIR=/app/data ENV RUSTDESK_PATH=/opt/rustdesk ENV DB_PATH=/opt/rustdesk/db_v2.sqlite3 diff --git a/Dockerfile.console b/Dockerfile.console index 1fbd8b2c..9507dce2 100644 --- a/Dockerfile.console +++ b/Dockerfile.console @@ -56,6 +56,7 @@ RUN mkdir -p /app/data /opt/rustdesk && \ ENV NODE_ENV=production ENV PORT=5000 ENV HOST=0.0.0.0 +ENV API_HOST=0.0.0.0 ENV DATA_DIR=/app/data ENV RUSTDESK_PATH=/opt/rustdesk ENV DB_PATH=/app/data/db_v2.sqlite3 diff --git a/docker-compose.quick.yml b/docker-compose.quick.yml index 937966a9..d60fcd4e 100644 --- a/docker-compose.quick.yml +++ b/docker-compose.quick.yml @@ -60,6 +60,8 @@ services: environment: - NODE_ENV=production - PORT=5000 + - HOST=0.0.0.0 + - API_HOST=0.0.0.0 - SERVER_BACKEND=betterdesk - BETTERDESK_API_URL=http://betterdesk-server:21114/api - RUSTDESK_PATH=/opt/rustdesk diff --git a/docker-compose.yml b/docker-compose.yml index c952e2f1..388aa0b9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -66,6 +66,8 @@ services: environment: - NODE_ENV=production - PORT=5000 + - HOST=0.0.0.0 + - API_HOST=0.0.0.0 - SERVER_BACKEND=betterdesk - HBBS_API_URL=http://betterdesk-server:21114/api - BETTERDESK_API_URL=http://betterdesk-server:21114/api diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index e8452e9b..9e42bdde 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -79,6 +79,10 @@ fi # Ensure Go server uses correct signal port (not NODE.js PORT) export SIGNAL_PORT="${SIGNAL_PORT:-21116}" +# Ensure Node.js Client API binds to all interfaces (not just localhost) +export API_HOST="${API_HOST:-0.0.0.0}" +export HOST="${HOST:-0.0.0.0}" + # Relay server address: if not explicitly set, try to auto-detect public IP. # Inside Docker, the Go server's own detection may return the container's # internal IP (172.x.x.x) which is unreachable by remote clients. diff --git a/docker/supervisord.conf b/docker/supervisord.conf index f8ce3190..c0a2378b 100644 --- a/docker/supervisord.conf +++ b/docker/supervisord.conf @@ -56,4 +56,6 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 +; Ensure Client API binds to all interfaces inside container +environment=API_HOST="0.0.0.0",HOST="0.0.0.0" priority=200