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
This commit is contained in:
M Firdaus Riawan 2025-09-10 22:20:38 +07:00 • committed by GitHub
commit b4d66648bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,28 +11,6 @@ services:
ports: ports:
- "3000:3000" - "3000:3000"
env_file: .env 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: volumes:
- ./sessions:/usr/src/app/sessions - ./sessions:/usr/src/app/sessions
# Optional healthcheck # Optional healthcheck