From c61d3882a2640cec80fe72854625e1f4c12f65c3 Mon Sep 17 00:00:00 2001 From: Dirham Triyadi <53885404+dirhamtriyadi@users.noreply.github.com> Date: Sun, 21 Jun 2026 02:01:51 +0700 Subject: [PATCH] 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. --- docker-compose.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index c900c36..1f38778 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,11 @@ services: - "${PORT:-3000}:${PORT:-3000}" env_file: .env 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. # Set PROXY_URL (and optionally PROXY_USERNAME / PROXY_PASSWORD for HTTP # 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_PASSWORD: "your-api-key" # 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: