From b4d66648bd0b0305b539d8a383b944800bc93262 Mon Sep 17 00:00:00 2001 From: M Firdaus Riawan <66874830+sonarta@users.noreply.github.com> Date: Wed, 10 Sep 2025 22:20:38 +0700 Subject: [PATCH] fix: Environment variable override in Docker Compose (#54) * feat: add reverse proxy support with configurable base path and trust proxy settings * fix: ensure environment variables are loaded correctly in Docker - Move dotenv config to the top of server.js - Update docker-compose.yml to properly handle .env file - Remove duplicate environment variables section This ensures BASE_PATH and TRUST_PROXY work as expected in both Docker and local environments. * refactor: remove hardcoded environment variables from docker-compose.yml --- docker-compose.yml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index cddbb08..1830936 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,28 +11,6 @@ services: ports: - "3000:3000" env_file: .env - environment: - # Core Configuration - - BASE_WEBHOOK_URL=http://localhost:3000/localCallbackExample - - MAX_ATTACHMENT_SIZE=5000000 # In bytes (5MB) - - SET_MESSAGES_AS_SEEN=TRUE - - ENABLE_LOCAL_CALLBACK_EXAMPLE=TRUE - - ENABLE_SWAGGER_ENDPOINT=TRUE - - RECOVER_SESSIONS=TRUE - - # Security Settings - # - API_KEY=your_global_api_key_here # Uncomment and set for production - - # Rate Limiting Configuration - # - RATE_LIMIT_MAX=1000 # Maximum connections per time window - # - RATE_LIMIT_WINDOW_MS=1000 # Time window in milliseconds - - # WhatsApp Web Configuration - # - WEB_VERSION='2.2328.5' # Specific WhatsApp Web version - # - WEB_VERSION_CACHE_TYPE=none # Options: local, remote, none - - # Callback Configuration - - DISABLED_CALLBACKS=message_ack|message_reaction volumes: - ./sessions:/usr/src/app/sessions # Optional healthcheck