Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(docker): make dev bind host configurable via BIND_HOST (#245)

Stanl3y8888ec101e95
diff --git a/.env.example b/.env.example
index 5bdd00759..74abef23e 100644
--- a/.env.example
+++ b/.env.example
@@ -18,6 +18,12 @@ AUTO_START_SESSIONS=false
DOMAIN=localhost
DASHBOARD_PORT=2886
+# Host interface the dev compose binds the API/dashboard ports to. Defaults to 127.0.0.1
+# (localhost only). Set to 0.0.0.0 to reach the dev stack from another machine (e.g. a remote
+# VPS) — put a TLS reverse proxy in front for anything internet-facing (the API key is sent in
+# cleartext over plain HTTP).
+# BIND_HOST=0.0.0.0
+
# Public URLs (for startup banner and external access)
# BASE_URL=https://api.yourdomain.com
# DASHBOARD_URL=https://dashboard.yourdomain.com
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index c881b2ced..cac3301af 100644
--- a/docker-compose.dev.yml
+++ b/docker-compose.dev.yml
@@ -32,7 +32,8 @@ services:
pids_limit: 512
mem_limit: ${OPENWA_MEM_LIMIT:-2g}
ports:
- - '127.0.0.1:2785:2785'
+ # Bind to localhost by default; set BIND_HOST=0.0.0.0 in .env to reach it from another host.
+ - '${BIND_HOST:-127.0.0.1}:2785:2785'
environment:
- NODE_ENV=development
- PORT=2785
@@ -66,7 +67,7 @@ services:
dockerfile: Dockerfile
container_name: openwa-dashboard
ports:
- - '127.0.0.1:2886:80'
+ - '${BIND_HOST:-127.0.0.1}:2886:80'
depends_on:
openwa:
condition: service_healthy