Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ services:
- N8N_SMTP_SSL=${N8N_SMTP_SSL:-false}
- N8N_SMTP_TLS=${N8N_SMTP_TLS:-true}
- N8N_BLOCKED_NODES=n8n-nodes-base.executeCommand,n8n-nodes-base.ssh
- N8N_DEFAULT_BINARY_DATA_MODE=filesystem
Comment on lines 21 to +22
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Persist binary data to a Docker volume

N8N_DEFAULT_BINARY_DATA_MODE=filesystem saves uploads to the container’s local disk.
Unless that directory is persisted via a named volume, all files will vanish on every redeploy.

Recommended follow-up:

       - N8N_DEFAULT_BINARY_DATA_MODE=filesystem
+      # Explicitly set the path and document it
+      - N8N_BINARY_DATA_STORAGE_PATH=/data/n8n

…and ensure the n8n service includes

volumes:
  - n8n_data:/data/n8n

This aligns with the team rule that all service data must be persisted in ./volumes/-mapped Docker volumes.


🏁 Script executed:

#!/bin/bash
# Check for existing n8n data volume mappings in docker-compose.prod.yml
grep -R "n8n" -n docker-compose.prod.yml | grep -A3 -i "volumes"
echo "-----"
grep -R "./volumes" -n docker-compose.prod.yml || echo "No local volumes bind mounts found"

Length of output: 207


🏁 Script executed:

#!/bin/bash
set -e
echo "=== n8n service block ==="
grep -R -n "^[[:space:]]*n8n:" -n docker-compose.prod.yml -A20

echo
echo "=== Root-level volumes definitions ==="
grep -R -n "^volumes:" -n docker-compose.prod.yml -A20

Length of output: 1654


Persist n8n binary data via Docker volume

The n8n service currently writes uploads to the container’s filesystem (N8N_DEFAULT_BINARY_DATA_MODE=filesystem) but doesn’t mount any volume at /data/n8n, so all files will be lost on each redeploy.

Apply these changes in docker-compose.prod.yml:

services:
  n8n:
    environment:
      - N8N_DEFAULT_BINARY_DATA_MODE=filesystem
+     - N8N_BINARY_DATA_STORAGE_PATH=/data/n8n
    volumes:
+     - n8n_data:/data/n8n

Ensure your root-level volume definition binds into ./volumes/n8n_data per project conventions:

volumes:
  n8n_data:
    driver: local
    driver_opts:
      type: none
      o: bind
-     device: /data/n8n
+     device: ./volumes/n8n_data

This guarantees that all binary uploads persist across deployments under volumes/n8n_data.

🤖 Prompt for AI Agents
In docker-compose.prod.yml around lines 21 to 22, the n8n service is set to
store binary data on the container filesystem without mounting a volume, causing
data loss on redeploy. Fix this by adding a volume mount for the n8n service
that binds the container path /data/n8n to a host directory like
./volumes/n8n_data. Also, define this volume at the root level of the
docker-compose file to ensure persistent storage of binary uploads across
deployments.

postgresql: !reset null

temporal:
Expand Down