Spaces:
Sleeping
Sleeping
File size: 2,023 Bytes
11713e2 223cfa0 11713e2 bb4e756 ae4b824 223cfa0 11713e2 4d7c889 223cfa0 5c841e4 3a85bbb 17c0c8b 5c841e4 223cfa0 11713e2 223cfa0 11713e2 4215a8b 223cfa0 11713e2 17c0c8b 223cfa0 11713e2 223cfa0 11713e2 223cfa0 aabe5da 4d7c889 17c0c8b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
FROM node:18-alpine
# Arguments that can be passed at build time
ARG N8N_PATH=/usr/local/lib/node_modules/n8n
ARG BASE_PATH=/root/.n8n
ARG DATABASE_PATH=$BASE_PATH/database
ARG CONFIG_PATH=$BASE_PATH/config
ARG WORKFLOWS_PATH=$BASE_PATH/workflows
ARG LOGS_PATH=$BASE_PATH/logs
ARG N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=$N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS
ARG N8N_HOST=$N8N_HOST
ARG N8N_PORT=$N8N_PORT
ARG N8N_PROTOCOL=https
ARG N8N_EDITOR_BASE_URL=$N8N_EDITOR_BASE_URL
ARG WEBHOOK_URL=$WEBHOOK_URL
ARG GENERIC_TIMEZONE=$GENERIC_TIMEZONE
ARG TZ=$TZ
ARG N8N_ENCRYPTION_KEY=$N8N_ENCRYPTION_KEY
ARG DB_TYPE=$DB_TYPE
ARG DB_POSTGRESDB_SCHEMA=$DB_POSTGRESDB_SCHEMA
ARG DB_POSTGRESDB_HOST=$DB_POSTGRESDB_HOST
ARG DB_POSTGRESDB_DATABASE=$DB_POSTGRESDB_DATABASE
ARG DB_POSTGRESDB_PORT=$DB_POSTGRESDB_PORT
ARG DB_POSTGRESDB_USER=$DB_POSTGRESDB_USER
ARG DB_POSTGRESDB_PASSWORD=$DB_POSTGRESDB_PASSWORD
# Install system dependencies
RUN apk add --no-cache git python3 py3-pip make g++ build-base cairo-dev pango-dev chromium postgresql-client ffmpeg fontconfig dejavu-fonts yt-dlp
# Install custom fonts
RUN mkdir -p /usr/share/fonts/truetype/custom
COPY /fonts/HanyiSentyPagoda_Regular.ttf /usr/share/fonts/truetype/custom/
RUN chmod 644 /usr/share/fonts/truetype/custom/HanyiSentyPagoda_Regular.ttf # 确保字体文件具有读取权限
RUN fc-cache -f -v
# Set environment variables
ENV PUPPETEER_SKIP_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
# Install n8n globally
RUN npm install -g [email protected]
# Create necessary directories
RUN mkdir -p $DATABASE_PATH $CONFIG_PATH $WORKFLOWS_PATH $LOGS_PATH
# Chown the directories to the n8n user (if n8n has a specific user)
# If n8n doesn't have a specific user, you can remove this section
RUN addgroup -g 1000 n8n && \
adduser -u 1000 -G n8n -s /bin/sh -D n8n
RUN chown -R n8n:n8n $BASE_PATH
# Switch to the n8n user. If n8n doesn't have a user, remove this.
USER n8n
# Set working directory
WORKDIR /data
# Start n8n
CMD ["n8n", "start"]
|