# Use Node.js as the base image instead of directly using n8n's image FROM node:18-bullseye # Set working directory WORKDIR /app # Install n8n globally RUN npm install -g n8n # Expose the correct port EXPOSE 7860 # Set environment variables for n8n ENV PORT=7860 ENV N8N_HOST=0.0.0.0 ENV N8N_PORT=7860 ENV N8N_PROTOCOL=http ENV N8N_DEFAULT_EXECUTIONS_MODE=queue # Ensure n8n is installed and accessible RUN which n8n # Start n8n CMD ["n8n"]