# Use the official n8n image directly (This is better) FROM n8nio/n8n:latest # Switch to root to fix permissions USER root # Create necessary folders and set permissions RUN mkdir -p /home/node/.n8n && \ chown -R node:node /home/node/.n8n && \ chmod -R 777 /home/node/.n8n # Set Port to 7860 (Hugging Face Requirement) ENV N8N_PORT=7860 EXPOSE 7860 # Security: Set your Username and Password ENV N8N_BASIC_AUTH_ACTIVE=true ENV N8N_BASIC_AUTH_USER=aditya ENV N8N_BASIC_AUTH_PASSWORD=AapkaSecretPassword # Switch back to node user for safety USER node # Start n8n using the direct path ENTRYPOINT ["n8n"] CMD ["start"]