forked from maslaknikolai/n8n-railway
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
44 lines (29 loc) · 824 Bytes
/
Dockerfile
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
FROM node:22-alpine
ARG N8N_VERSION=latest
ARG PGPASSWORD
ARG PGHOST
ARG PGPORT
ARG PGDATABASE
ARG PGUSER
ARG USERNAME
ARG PASSWORD
ARG ENCRYPTIONKEY
ENV N8N_ENCRYPTION_KEY=$ENCRYPTIONKEY
ENV DB_TYPE=postgresdb
ENV DB_POSTGRESDB_DATABASE=$PGDATABASE
ENV DB_POSTGRESDB_HOST=$PGHOST
ENV DB_POSTGRESDB_PORT=$PGPORT
ENV DB_POSTGRESDB_USER=$PGUSER
ENV DB_POSTGRESDB_PASSWORD=$PGPASSWORD
ENV N8N_BASIC_AUTH_ACTIVE=true
ENV N8N_BASIC_AUTH_USER=$USERNAME
ENV N8N_BASIC_AUTH_PASSWORD=$PASSWORD
ENV N8N_USER_ID=root
RUN apk add --update graphicsmagick tzdata
USER root
RUN apk --update add --virtual build-dependencies python3 build-base && \
npm_config_user=root npm install --location=global n8n@${N8N_VERSION} && \
apk del build-dependencies
WORKDIR /data
EXPOSE $PORT
CMD export N8N_PORT=$PORT && n8n start