Update docker-compose.prod.yml. Add N8N_DEFAULT_BINARY_DATA_MODE for …#81
Update docker-compose.prod.yml. Add N8N_DEFAULT_BINARY_DATA_MODE for …#81SashkoMarchuk wants to merge 1 commit intospeedandfunction:mainfrom
Conversation
📝 WalkthroughWalkthroughA new environment variable, Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested reviewers
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docker-compose.prod.yml(1 hunks)
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-28T16:44:50.073Z
Learning: Applies to Dockerfile.n8n : Use Dockerfile.n8n for custom n8n image configuration.
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/docker-configuration.mdc:0-0
Timestamp: 2025-07-28T16:44:24.081Z
Learning: Applies to volumes/**/* : All service data must be persisted in Docker volumes mapped to the local volumes/ directory, such as ./volumes/n8n_data, ./volumes/opensearch-data, and ./volumes/postgresql-data
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/docker-configuration.mdc:0-0
Timestamp: 2025-07-28T16:44:24.081Z
Learning: Applies to docker-compose.yml : Services must communicate over an internal Docker network with only the specified ports exposed: n8n (5678), Temporal (7233), Temporal UI (8080), PostgreSQL (5432), and OpenSearch (9200)
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/docker-configuration.mdc:0-0
Timestamp: 2025-07-28T16:44:24.081Z
Learning: Applies to Dockerfile.{n8n,temporal} : Custom Docker images must be defined using Dockerfile.n8n and Dockerfile.temporal, each extending their respective official base images with custom configurations
📚 Learning: applies to docker-compose.yml : services must communicate over an internal docker network with only ...
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/docker-configuration.mdc:0-0
Timestamp: 2025-07-28T16:44:24.081Z
Learning: Applies to docker-compose.yml : Services must communicate over an internal Docker network with only the specified ports exposed: n8n (5678), Temporal (7233), Temporal UI (8080), PostgreSQL (5432), and OpenSearch (9200)
Applied to files:
docker-compose.prod.yml
📚 Learning: applies to docker-compose.yml : all service configurations, including service dependencies, volume m...
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/docker-configuration.mdc:0-0
Timestamp: 2025-07-28T16:44:24.081Z
Learning: Applies to docker-compose.yml : All service configurations, including service dependencies, volume mounts, network configuration, environment variables, and port mappings, must be defined in docker-compose.yml
Applied to files:
docker-compose.prod.yml
📚 Learning: applies to dockerfile.n8n : use dockerfile.n8n for custom n8n image configuration....
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-28T16:44:50.073Z
Learning: Applies to Dockerfile.n8n : Use Dockerfile.n8n for custom n8n image configuration.
Applied to files:
docker-compose.prod.yml
📚 Learning: applies to dockerfile.{n8n,temporal} : custom docker images must be defined using dockerfile.n8n and...
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/docker-configuration.mdc:0-0
Timestamp: 2025-07-28T16:44:24.081Z
Learning: Applies to Dockerfile.{n8n,temporal} : Custom Docker images must be defined using Dockerfile.n8n and Dockerfile.temporal, each extending their respective official base images with custom configurations
Applied to files:
docker-compose.prod.yml
📚 Learning: applies to docker-compose.yml : the repository must include a docker-compose.yml file as the main se...
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-28T16:44:50.073Z
Learning: Applies to docker-compose.yml : The repository must include a docker-compose.yml file as the main service orchestration configuration.
Applied to files:
docker-compose.prod.yml
📚 Learning: the project architecture must include interconnected services: n8n, temporal server, temporal ui, po...
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-28T16:44:50.073Z
Learning: The project architecture must include interconnected services: n8n, Temporal Server, Temporal UI, PostgreSQL, and OpenSearch, each running on their specified ports.
Applied to files:
docker-compose.prod.yml
📚 Learning: applies to dockerfile.temporal : use dockerfile.temporal for custom temporal image configuration....
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-28T16:44:50.073Z
Learning: Applies to Dockerfile.temporal : Use Dockerfile.temporal for custom Temporal image configuration.
Applied to files:
docker-compose.prod.yml
📚 Learning: applies to volumes/**/* : all service data must be persisted in docker volumes mapped to the local v...
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/docker-configuration.mdc:0-0
Timestamp: 2025-07-28T16:44:24.081Z
Learning: Applies to volumes/**/* : All service data must be persisted in Docker volumes mapped to the local volumes/ directory, such as ./volumes/n8n_data, ./volumes/opensearch-data, and ./volumes/postgresql-data
Applied to files:
docker-compose.prod.yml
| - N8N_BLOCKED_NODES=n8n-nodes-base.executeCommand,n8n-nodes-base.ssh | ||
| - N8N_DEFAULT_BINARY_DATA_MODE=filesystem |
There was a problem hiding this comment.
💡 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/n8nThis 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 -A20Length 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/n8nEnsure 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_dataThis 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.
killev
left a comment
There was a problem hiding this comment.
Read suggestion from coderabbit
|
Reason for closing. Already updated in #82 |
…file uploading