Spaces:
Running
Running
File size: 1,545 Bytes
44ee7fe | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | # n8n self-hosted image (Hugging Face Spaces / any Docker host)
# HF Spaces runs the container as uid 1000 (= "node" user in node images),
# so we run as node and keep all writable data in /home/node.
FROM node:24-alpine
USER root
RUN apk add --no-cache \
git python3 py3-pip make g++ build-base \
cairo-dev pango-dev chromium postgresql-client yt-dlp \
tini curl
# Pin a version that really exists. If the build fails with "No matching version",
# change this to n8n@latest (or run: npm view n8n versions --json to see valid ones).
RUN npm install -g n8n@2.42.6
# Writable data folder for uid 1000
RUN mkdir -p /home/node/.n8n && chown -R node:node /home/node
ENV NODE_OPTIONS="--dns-result-order=ipv4first" \
PUPPETEER_SKIP_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium \
N8N_RUNNERS_ENABLED=true \
N8N_PORT=7860 \
N8N_LISTEN_ADDRESS=0.0.0.0 \
N8N_USER_FOLDER=/home/node \
HOME=/home/node \
N8N_PROTOCOL=https \
N8N_PROXY_HOPS=1 \
N8N_DEFAULT_BINARY_DATA_MODE=filesystem \
N8N_DIAGNOSTICS_ENABLED=false \
N8N_PERSONALIZATION_ENABLED=false \
EXECUTIONS_DATA_PRUNE=true \
EXECUTIONS_DATA_MAX_AGE=168 \
GENERIC_TIMEZONE=Asia/Kolkata \
TZ=Asia/Kolkata \
NODE_FUNCTION_ALLOW_BUILTIN=* \
NODE_FUNCTION_ALLOW_EXTERNAL=*
USER node
WORKDIR /home/node
EXPOSE 7860
HEALTHCHECK --interval=60s --timeout=10s --start-period=90s --retries=3 \
CMD curl -fs http://127.0.0.1:7860/healthz || exit 1
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["n8n", "start"]
|