n8n / Dockerfile
ThatandMoore's picture
Deploy n8n
8cf35c5 verified
Raw History Blame Contribute Delete
1.54 kB
# n8n on a free Hugging Face Space, with its database in Supabase.
#
# Nothing secret lives in this file. The two secrets are set in the
# Space's Settings -> Variables and secrets:
# DB_POSTGRESDB_PASSWORD your Supabase database password
# N8N_ENCRYPTION_KEY random 64-hex string (encrypts saved credentials)
FROM docker.io/n8nio/n8n:latest
# HF runs containers as user 1000 (= "node" in this image). Give it a
# writable home for n8n's small local files.
USER root
RUN mkdir -p /data && chown -R node:node /data
USER node
ENV N8N_USER_FOLDER=/data \
# --- where n8n is reachable (HF Spaces listen on 7860) ---
N8N_PORT=7860 \
N8N_HOST=thatandmoore-n8n.hf.space \
N8N_PROTOCOL=https \
N8N_PROXY_HOPS=1 \
WEBHOOK_URL=https://thatandmoore-n8n.hf.space/ \
N8N_EDITOR_BASE_URL=https://thatandmoore-n8n.hf.space/ \
# --- database: Supabase Postgres, schema "n8n", via the pooler ---
DB_TYPE=postgresdb \
DB_POSTGRESDB_HOST=aws-0-ca-central-1.pooler.supabase.com \
DB_POSTGRESDB_PORT=5432 \
DB_POSTGRESDB_DATABASE=postgres \
DB_POSTGRESDB_USER=postgres.aulgdrsyqsachiaeixxn \
DB_POSTGRESDB_SCHEMA=n8n \
DB_POSTGRESDB_SSL_ENABLED=true \
DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED=false \
DB_POSTGRESDB_POOL_SIZE=2 \
# --- housekeeping ---
N8N_RUNNERS_ENABLED=true \
N8N_DIAGNOSTICS_ENABLED=false \
EXECUTIONS_DATA_PRUNE=true \
EXECUTIONS_DATA_MAX_AGE=168 \
GENERIC_TIMEZONE=America/New_York
EXPOSE 7860