-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 995 Bytes
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 995 Bytes
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
FROM bitovi/n8n-community-nodes:latest
USER root
# Install bash and OpenSSL for certificate generation
RUN apk update && apk add --no-cache bash openssl
# Set proper ownership for npm global directories
RUN chown -R node:node /usr/local/lib /usr/local/bin
USER node
# Create directory for certificates
RUN mkdir -p /home/node/certificates
WORKDIR /home/node/certificates
# Generate self-signed certificate
RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout n8n-key.pem -out n8n-cert.pem \
-subj "/C=US/ST=State/L=City/O=Organization/CN=localhost"
# Set proper permissions for the private key
RUN chmod 600 /home/node/certificates/n8n-key.pem
# Set environment variables for SSL configuration
ENV N8N_PROTOCOL=https
ENV N8N_SSL_KEY=/home/node/certificates/n8n-key.pem
ENV N8N_SSL_CERT=/home/node/certificates/n8n-cert.pem
# You can set a custom entrypoint here to check the certificate files before starting n8n
# or use the default one provided by the base image