Spaces:
Runtime error
Runtime error
musarehmani100
commited on
Commit
•
f3bafdb
1
Parent(s):
d217a5b
Update Dockerfile
Browse files- Dockerfile +16 -25
Dockerfile
CHANGED
@@ -1,36 +1,27 @@
|
|
1 |
-
# Stage 1: Build Environment
|
2 |
ARG NODE_VERSION=18
|
3 |
-
FROM node:${NODE_VERSION}-slim as builder
|
4 |
-
|
5 |
-
ARG N8N_VERSION=1.39.0
|
6 |
-
ENV N8N_VERSION ${N8N_VERSION}
|
7 |
-
ENV NODE_ENV production
|
8 |
-
ENV N8N_RELEASE_TYPE stable
|
9 |
-
|
10 |
-
WORKDIR /app
|
11 |
-
|
12 |
-
COPY package*.json ./
|
13 |
-
RUN set -exu; \
|
14 |
-
npm ci && \
|
15 |
-
npm install -g --omit=dev n8n@${N8N_VERSION} --ignore-scripts && \
|
16 |
-
npm rebuild --prefix=/app/node_modules/n8n sqlite3
|
17 |
-
|
18 |
-
COPY . .
|
19 |
-
RUN find . -type f \( -iname '*.ts' -o -iname '*.js.map' -o -iname '*.vue' \) -delete
|
20 |
-
|
21 |
-
# Stage 2: Production Environment
|
22 |
FROM n8nio/base:${NODE_VERSION}
|
23 |
|
24 |
-
|
25 |
-
ENV
|
|
|
|
|
26 |
|
27 |
WORKDIR /app
|
28 |
|
29 |
-
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
COPY docker-entrypoint.sh /
|
33 |
-
RUN chmod +x /docker-entrypoint.sh
|
34 |
|
|
|
|
|
|
|
|
|
35 |
USER node
|
36 |
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
|
|
|
|
|
1 |
ARG NODE_VERSION=18
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
FROM n8nio/base:${NODE_VERSION}
|
3 |
|
4 |
+
ARG N8N_VERSION=1.39.0
|
5 |
+
ENV N8N_VERSION=${N8N_VERSION}
|
6 |
+
ENV NODE_ENV=production
|
7 |
+
ENV N8N_RELEASE_TYPE=stable
|
8 |
|
9 |
WORKDIR /app
|
10 |
|
11 |
+
RUN set -eux; \
|
12 |
+
npm install -g --omit=dev n8n@${N8N_VERSION} --ignore-scripts && \
|
13 |
+
npm rebuild --prefix=/usr/local/lib/node_modules/n8n sqlite3 && \
|
14 |
+
rm -rf /usr/local/lib/node_modules/n8n/node_modules/@n8n/chat && \
|
15 |
+
rm -rf /usr/local/lib/node_modules/n8n/node_modules/n8n-design-system && \
|
16 |
+
rm -rf /usr/local/lib/node_modules/n8n/node_modules/n8n-editor-ui/node_modules && \
|
17 |
+
find /usr/local/lib/node_modules/n8n -type f -name "*.ts" -o -name "*.js.map" -o -name "*.vue" | xargs rm -f && \
|
18 |
+
rm -rf /root/.npm
|
19 |
|
20 |
COPY docker-entrypoint.sh /
|
|
|
21 |
|
22 |
+
RUN \
|
23 |
+
mkdir .n8n && \
|
24 |
+
chown node:node .n8n
|
25 |
+
ENV SHELL /bin/sh
|
26 |
USER node
|
27 |
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
|