Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
fix(docker): publish the dev compose API on API_PORT
Yudhi Armyndharisaf59c20d4675
diff --git a/docker-compose.dev.yml b/docker-compose.dev.ymlindex ca508938f..82777ea30 100644--- a/docker-compose.dev.yml+++ b/docker-compose.dev.yml@@ -35,8 +35,9 @@ services:pids_limit: ${OPENWA_PIDS_LIMIT:-2048}mem_limit: ${OPENWA_MEM_LIMIT:-2g}ports:- # 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'+ # Bind to localhost by default; set BIND_HOST=0.0.0.0 in .env to reach it from another host, and+ # API_PORT to publish on a host port other than 2785.+ - '${BIND_HOST:-127.0.0.1}:${API_PORT:-2785}:2785'# User-facing settings read from the environment (or .env) with a sane default fallback# (${VAR:-default}); override any of them without editing this file. The data paths default# under /app/data (the ./data bind mount) so they persist out of the box — override only if youdiff --git a/src/modules/docker/compose-parity.spec.ts b/src/modules/docker/compose-parity.spec.tsindex 431b5ce2e..635b3a13f 100644--- a/src/modules/docker/compose-parity.spec.ts+++ b/src/modules/docker/compose-parity.spec.ts@@ -368,6 +368,14 @@ describe('DockerService managed specs ↔ docker-compose.yml parity', () => {}});+ // .env.example documents API_PORT as the host port Docker Compose publishes, and the README quick+ // start runs the dev file, so a hardcoded 2785 there ignores the knob when that port is taken.+ it.each(['docker-compose.yml', 'docker-compose.dev.yml'])('%s publishes the API on the API_PORT host port', file => {+ const parsed = yaml.load(readFileSync(join(__dirname, '../../..', file), 'utf8')) as ComposeFile;+ const api = Object.values(parsed.services).find(service => service.container_name === 'openwa-api');+ expect(api?.ports).toEqual([expect.stringMatching(/:\$\{API_PORT:-2785\}:2785$/)]);+ });+it('redis: sets the noeviction maxmemory policy BullMQ requires, on both launch paths', async () => {const cfg = await capture('redis');// The parity assertion above only proves the two launch paths AGREE — dropping the flag from