Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files12345613 unmodified lines20212223242514 unmodified lines404142434445# IMPORTANT: don't use :latest -- recent n8n Docker builds have a known# "Command n8n not found" bug on Spaces. Pin to a known-good version.FROM n8nio/n8n:1.120.4# --- Basic n8n / HF Spaces networking ---ENV N8N_PORT=786013 unmodified lines# fixes the X-Forwarded-For / trust proxy warningENV N8N_PROXY_HOPS=1# --- Supabase Postgres (Shared Pooler - Transaction mode, port 6543) ---ENV DB_TYPE=postgresdbENV DB_POSTGRESDB_HOST=aws-0-ap-northeast-1.pooler.supabase.com14 unmodified lines# N8N_ENCRYPTION_KEY -> set via Space secrets, never hardcode/leave blank# This MUST be set, or every restart wipes access to saved credentials.EXPOSE 7860CMD ["start"]123456789101113 unmodified lines25262728293031323314 unmodified lines484950515253545556575859606162636465666768697071727374# Base on a plain Node image and install n8n ourselves via npm.# This avoids the official n8nio/n8n image's entrypoint bug# ("Command n8n not found") entirely, since we control CMD directly.FROM node:22-slimARG N8N_VERSION=1.120.4ENV DEBIAN_FRONTEND=noninteractive# --- Basic n8n / HF Spaces networking ---ENV N8N_PORT=786013 unmodified lines# fixes the X-Forwarded-For / trust proxy warningENV N8N_PROXY_HOPS=1# fixes the "Permissions 0644 ... too wide" warningENV N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true# --- Supabase Postgres (Shared Pooler - Transaction mode, port 6543) ---ENV DB_TYPE=postgresdbENV DB_POSTGRESDB_HOST=aws-0-ap-northeast-1.pooler.supabase.com14 unmodified lines# N8N_ENCRYPTION_KEY -> set via Space secrets, never hardcode/leave blank# This MUST be set, or every restart wipes access to saved credentials.# Install system deps + n8n itself, pinned version for reproducibilityRUN apt-get update && apt-get install -y -q --no-install-recommends \ca-certificates \curl \git \tini \&& npm install -g --loglevel=error n8n@${N8N_VERSION} \&& rm -rf /var/lib/apt/lists/*# n8n's home/data folder with correct ownership + permissionsRUN mkdir -p /home/node/.n8n && \chmod 700 /home/node/.n8n && \chown -R node:node /home/nodeUSER nodeWORKDIR /home/nodeEXPOSE 7860HEALTHCHECK --interval=30s --timeout=5s --start-period=60s \CMD curl -fsS http://localhost:7860/healthz || exit 1ENTRYPOINT ["/usr/bin/tini", "--"]CMD ["n8n", "start"]
Dockerfile+33-4