Update Dockerfile
Browse files- Dockerfile +11 -2
Dockerfile
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
FROM node:18-alpine
|
|
|
2 |
# Set user to root for installation
|
3 |
USER root
|
|
|
4 |
# Arguments that can be passed at build time
|
5 |
ARG N8N_PATH=/usr/local/lib/node_modules/n8n
|
6 |
ARG BASE_PATH=/root/.n8n
|
@@ -24,6 +26,7 @@ ARG DB_POSTGRESDB_DATABASE=$DB_POSTGRESDB_DATABASE
|
|
24 |
ARG DB_POSTGRESDB_PORT=$DB_POSTGRESDB_PORT
|
25 |
ARG DB_POSTGRESDB_USER=$DB_POSTGRESDB_USER
|
26 |
ARG DB_POSTGRESDB_PASSWORD=$DB_POSTGRESDB_PASSWORD
|
|
|
27 |
# Install system dependencies
|
28 |
RUN apk add --no-cache \
|
29 |
git \
|
@@ -38,21 +41,27 @@ RUN apk add --no-cache \
|
|
38 |
postgresql-client \
|
39 |
ffmpeg \
|
40 |
fontconfig \ # 关键:添加 fontconfig
|
41 |
-
|
42 |
yt-dlp
|
|
|
43 |
# Install custom fonts
|
44 |
RUN mkdir -p /usr/share/fonts/truetype/custom
|
45 |
COPY ./fonts/HanyiSentyPagoda_Regular.ttf /usr/share/fonts/truetype/custom/
|
46 |
RUN fc-cache -f -v
|
|
|
47 |
# Set environment variables
|
48 |
ENV PUPPETEER_SKIP_DOWNLOAD=true
|
49 |
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
|
|
50 |
# Install n8n globally
|
51 |
RUN npm install -g [email protected]
|
|
|
52 |
# Create necessary directories
|
53 |
RUN mkdir -p $DATABASE_PATH $CONFIG_PATH $WORKFLOWS_PATH $LOGS_PATH \
|
54 |
&& chmod -R 777 $BASE_PATH
|
|
|
55 |
# Set working directory
|
56 |
WORKDIR /data
|
|
|
57 |
# Start n8n
|
58 |
-
CMD ["n8n", "start"]
|
|
|
1 |
FROM node:18-alpine
|
2 |
+
|
3 |
# Set user to root for installation
|
4 |
USER root
|
5 |
+
|
6 |
# Arguments that can be passed at build time
|
7 |
ARG N8N_PATH=/usr/local/lib/node_modules/n8n
|
8 |
ARG BASE_PATH=/root/.n8n
|
|
|
26 |
ARG DB_POSTGRESDB_PORT=$DB_POSTGRESDB_PORT
|
27 |
ARG DB_POSTGRESDB_USER=$DB_POSTGRESDB_USER
|
28 |
ARG DB_POSTGRESDB_PASSWORD=$DB_POSTGRESDB_PASSWORD
|
29 |
+
|
30 |
# Install system dependencies
|
31 |
RUN apk add --no-cache \
|
32 |
git \
|
|
|
41 |
postgresql-client \
|
42 |
ffmpeg \
|
43 |
fontconfig \ # 关键:添加 fontconfig
|
44 |
+
font-dejavu \ # 可选:添加一些默认字体
|
45 |
yt-dlp
|
46 |
+
|
47 |
# Install custom fonts
|
48 |
RUN mkdir -p /usr/share/fonts/truetype/custom
|
49 |
COPY ./fonts/HanyiSentyPagoda_Regular.ttf /usr/share/fonts/truetype/custom/
|
50 |
RUN fc-cache -f -v
|
51 |
+
|
52 |
# Set environment variables
|
53 |
ENV PUPPETEER_SKIP_DOWNLOAD=true
|
54 |
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
55 |
+
|
56 |
# Install n8n globally
|
57 |
RUN npm install -g [email protected]
|
58 |
+
|
59 |
# Create necessary directories
|
60 |
RUN mkdir -p $DATABASE_PATH $CONFIG_PATH $WORKFLOWS_PATH $LOGS_PATH \
|
61 |
&& chmod -R 777 $BASE_PATH
|
62 |
+
|
63 |
# Set working directory
|
64 |
WORKDIR /data
|
65 |
+
|
66 |
# Start n8n
|
67 |
+
CMD ["n8n", "start"]
|