n8n / Dockerfile
Rachneet's picture
chore: update n8n version
582dd5c
raw
history blame contribute delete
828 Bytes
FROM node:22-alpine
USER root
# 1. Install system dependencies (tini for proper signal handling like official image)
RUN apk add --no-cache \
bash \
curl \
git \
tini \
procps \
openssh \
python3 \
make \
g++ \
build-base \
chromium \
postgresql-client
# 2. Install n8n as a local dependency
WORKDIR /home/node
RUN npm install n8n@latest
# 3. Fix permissions for Hugging Face (User 1000)
RUN mkdir -p /home/node/.n8n && chown -R 1000:1000 /home/node /home/node/.n8n
RUN chmod -R 777 /home/node/.n8n
USER node
ENV NODE_ENV=production
ENV N8N_PORT=7860
ENV N8N_USER_FOLDER=/home/node/.n8n
ENV PATH="/home/node/node_modules/.bin:${PATH}"
EXPOSE 7860/tcp
# 4. Use tini as entrypoint (matches official image for graceful shutdown)
ENTRYPOINT ["tini", "--"]
CMD ["n8n", "start"]