n8n / Dockerfile
abubasith86's picture
Update Dockerfile
5db29f2 verified
raw
history blame contribute delete
435 Bytes
FROM node:20-slim
# Set UID for the new user (optional, but best practice)
ARG APP_UID=1024
# Create a non-root user
RUN useradd --create-home --uid ${APP_UID} appuser
# Set working directory
WORKDIR /home/appuser/app
# Install n8n globally
RUN npm install -g n8n
# Switch to non-root user
USER appuser
# Expose port 7860 (required by Hugging Face Spaces)
EXPOSE 7860
# Start n8n directly
CMD ["n8n", "start", "--port", "7860"]