Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +7 -2
Dockerfile
CHANGED
@@ -1,6 +1,11 @@
|
|
1 |
# Use the official n8n Docker image as the base image
|
2 |
FROM docker.n8n.io/n8nio/n8n:latest
|
3 |
|
|
|
|
|
|
|
|
|
|
|
4 |
# Set environment variables for n8n
|
5 |
ENV GENERIC_TIMEZONE="Asia/Dubai" \
|
6 |
TZ="Asia/Dubai" \
|
@@ -14,5 +19,5 @@ WORKDIR /data
|
|
14 |
# Expose port 5678 (default port for n8n)
|
15 |
EXPOSE 5678
|
16 |
|
17 |
-
#
|
18 |
-
CMD ["n8n"]
|
|
|
1 |
# Use the official n8n Docker image as the base image
|
2 |
FROM docker.n8n.io/n8nio/n8n:latest
|
3 |
|
4 |
+
# Use the secret securely during the build process
|
5 |
+
RUN --mount=type=secret,id=N8N_AUTH_PASSWORD,mode=0444,required=true \
|
6 |
+
echo "N8N_BASIC_AUTH_PASSWORD=$(cat /run/secrets/N8N_AUTH_PASSWORD)" >> /etc/environment
|
7 |
+
|
8 |
+
|
9 |
# Set environment variables for n8n
|
10 |
ENV GENERIC_TIMEZONE="Asia/Dubai" \
|
11 |
TZ="Asia/Dubai" \
|
|
|
19 |
# Expose port 5678 (default port for n8n)
|
20 |
EXPOSE 5678
|
21 |
|
22 |
+
# Command to run n8n
|
23 |
+
CMD ["sh", "-c", ". /etc/environment && n8n"]
|