# # Use the official n8n image # FROM n8nio/n8n # # Hugging Face expects the service to run on port 7860 # ENV N8N_PORT=7860 # ENV N8N_HOST=0.0.0.0 # # Optional basic auth # ENV N8N_BASIC_AUTH_ACTIVE=true # ENV N8N_BASIC_AUTH_USER=admin # ENV N8N_BASIC_AUTH_PASSWORD=password # EXPOSE 7860 # # Run n8n on port 7860 # CMD ["n8n", "start"] # Use official Node.js image FROM node:18-slim # Install required dependencies RUN apt-get update && apt-get install -y \ python3 \ python3-pip \ git \ && rm -rf /var/lib/apt/lists/* # Install n8n globally RUN npm install -g n8n # Create user and set up directories (n8n requires a home directory) # RUN useradd -m -s /bin/bash node USER node WORKDIR /home/node # Set Hugging Face port and n8n host ENV N8N_PORT=7860 ENV N8N_HOST=0.0.0.0 # Optional: Enable basic authentication ENV N8N_BASIC_AUTH_ACTIVE=true ENV N8N_BASIC_AUTH_USER=admin ENV N8N_BASIC_AUTH_PASSWORD=password EXPOSE 7860 # Start n8n CMD ["n8n"]