Create Dockerfile
Browse files- Dockerfile +33 -0
Dockerfile
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM n8nio/n8n:latest
|
2 |
+
|
3 |
+
ENV NODE_ENV=production
|
4 |
+
|
5 |
+
USER root
|
6 |
+
RUN chmod 777 /usr/local/lib/node_modules
|
7 |
+
|
8 |
+
RUN apk update && apk add --no-cache postgresql-client && rm -rf /var/cache/apk/*
|
9 |
+
|
10 |
+
RUN set -eux; \
|
11 |
+
apkArch="$(apk --print-arch)"; \
|
12 |
+
if [ "$apkArch" = "armv7" ]; then \
|
13 |
+
apk --no-cache add --virtual build-dependencies python3 build-base && \
|
14 |
+
apk del build-dependencies; \
|
15 |
+
fi; \
|
16 |
+
find /usr/local/lib/node_modules/n8n -type f \( -name "*.ts" -o -name "*.js.map" -o -name "*.vue" \) -delete && \
|
17 |
+
rm -rf /root/.npm
|
18 |
+
|
19 |
+
RUN mkdir -p /home/node/.n8n/nodes
|
20 |
+
WORKDIR /home/node/.n8n/nodes
|
21 |
+
RUN cd /home/node/.n8n/nodes
|
22 |
+
RUN npm install n8n-nodes-browserless
|
23 |
+
RUN ls -lah
|
24 |
+
|
25 |
+
# Set a custom user to not have n8n run as root
|
26 |
+
USER root
|
27 |
+
WORKDIR /data
|
28 |
+
RUN apk --no-cache add su-exec
|
29 |
+
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
30 |
+
RUN chmod +x /docker-entrypoint.sh
|
31 |
+
RUN chmod 777 /usr/local/lib/node_modules
|
32 |
+
RUN chmod -R 777 /home/node/.n8n/nodes
|
33 |
+
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
|