n8n / Dockerfile
dreosstudio's picture
Update Dockerfile
76a8550 verified
Raw
History Blame Contribute Delete
1.06 kB
FROM n8nio/n8n:latest
USER root
RUN chown -R 1000:1000 /home/node/.n8n
USER node
# HuggingFace Spaces requires port 7860
ENV N8N_PORT=7860
# Fix iframe/cookie issues behind HuggingFace proxy
ENV N8N_SECURE_COOKIE=false
# Database — Supabase PostgreSQL
ENV DB_TYPE=postgresdb
ENV DB_POSTGRESDB_PORT=6543
ENV DB_POSTGRESDB_DATABASE=postgres
ENV DB_POSTGRESDB_SCHEMA=public
# Critical: explicitly tell n8n its public URL and protocol
# Without these, n8n guesses wrong and OAuth state breaks
ENV N8N_HOST=dreosstudio-n8n.hf.space
ENV N8N_PROTOCOL=https
# Critical: trust HuggingFace reverse proxy (fixes X-Forwarded-For + OAuth state)
ENV N8N_PROXY_HOPS=1
# Required settings
ENV N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
ENV EXECUTIONS_MODE=regular
# Secrets — set these in HuggingFace Space Settings → Variables and Secrets:
# DB_POSTGRESDB_HOST
# DB_POSTGRESDB_USER
# DB_POSTGRESDB_PASSWORD
# N8N_ENCRYPTION_KEY
# WEBHOOK_URL = https://dreosstudio-n8n.hf.space/
# N8N_EDITOR_BASE_URL = https://dreosstudio-n8n.hf.space/
CMD ["start"]