Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files123456789101112131415161718192021FROM n8nio/n8n:latestUSER root# 1. Install Python and Pip# We use apk (Alpine's package manager) to add python3 and common toolsRUN apk add --update --no-cache python3 py3-pip build-base python3-dev# 2. Setup a virtual environment (Good practice for Python 3.11+)RUN python3 -m venv /opt/venvENV PATH="/opt/venv/bin:$PATH"RUN pip install requests pandas# 3. Ensure the node user has access to its home directoryRUN mkdir -p /home/node/.n8n && chmod -R 777 /home/node/.n8n# Hugging Face uses port 7860ENV N8N_PORT=7860EXPOSE 7860123456789101112131415161718192021222324252627282930# STAGE 1: Grab the package manager tools from a standard Alpine imageFROM alpine:latest AS alpine-toolsRUN apk add --no-cache apk-tools# STAGE 2: Build our custom n8n imageFROM n8nio/n8n:latestUSER root# Copy the apk binary and its configuration from the first stageCOPY --from=alpine-tools /sbin/apk /sbin/apkCOPY --from=alpine-tools /lib/libz.so.1 /lib/libz.so.1COPY --from=alpine-tools /usr/lib/libcrypto.so.3 /usr/lib/libcrypto.so.3COPY --from=alpine-tools /usr/lib/libssl.so.3 /usr/lib/libssl.so.3COPY --from=alpine-tools /etc/apk /etc/apk# Now we can use apk to install Python 3 and PipRUN apk add --update --no-cache python3 py3-pip build-base python3-dev# Setup the virtual environmentRUN python3 -m venv /opt/venvENV PATH="/opt/venv/bin:$PATH"# Ensure the node user has access to its home directoryRUN mkdir -p /home/node/.n8n && chmod -R 777 /home/node/.n8n# Hugging Face port configurationENV N8N_PORT=7860EXPOSE 7860
Dockerfile+16-7