Persist sessions in named volume instead of repo bind mount (#133)

Replace the relative ./sessions bind mount with a Docker-managed named
volume so WhatsApp sessions survive container recreation and redeploys
(e.g. on Dokploy), instead of being reset on every fresh deploy.
This commit is contained in:
Dirham Triyadi 2026-06-21 02:01:51 +07:00 • committed by GitHub
commit c61d3882a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,7 +12,11 @@ services:
- "${PORT:-3000}:${PORT:-3000}" - "${PORT:-3000}:${PORT:-3000}"
env_file: .env env_file: .env
volumes: volumes:
- ./sessions:/usr/src/app/sessions # Use a named Docker volume so WhatsApp sessions persist across
# container recreations / redeploys (e.g. on Dokploy). The data lives
# in Docker-managed storage, NOT inside the repository directory, so a
# fresh deploy no longer resets the session.
- wwebjs_sessions:/usr/src/app/sessions
# Optional: route Chromium (WhatsApp Web) traffic through an outbound proxy. # Optional: route Chromium (WhatsApp Web) traffic through an outbound proxy.
# Set PROXY_URL (and optionally PROXY_USERNAME / PROXY_PASSWORD for HTTP # Set PROXY_URL (and optionally PROXY_USERNAME / PROXY_PASSWORD for HTTP
# Basic auth) in .env, or uncomment the block below to point at the # Basic auth) in .env, or uncomment the block below to point at the
@ -44,3 +48,8 @@ services:
# # BASIC_AUTH_USER: "api-key" # # BASIC_AUTH_USER: "api-key"
# # BASIC_AUTH_PASSWORD: "your-api-key" # # BASIC_AUTH_PASSWORD: "your-api-key"
# restart: unless-stopped # restart: unless-stopped
# Named volumes managed by Docker. Persists independently of the container
# and the repository working directory, so sessions survive redeploys.
volumes:
wwebjs_sessions: