Update Dockerfile
Browse files- Dockerfile +15 -18
Dockerfile
CHANGED
|
@@ -8,27 +8,24 @@ ENV N8N_PORT=7860
|
|
| 8 |
ENV GENERIC_TIMEZONE="UTC"
|
| 9 |
# ENV N8N_DIAGNOSTICS_ENABLED=false
|
| 10 |
|
| 11 |
-
#
|
| 12 |
-
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
RUN chmod +x ./start.sh
|
| 21 |
-
# It's good practice to switch back to the image's default user if you know it,
|
| 22 |
-
# but for n8n, the entrypoint/cmd will likely run as the correct user anyway.
|
| 23 |
-
# If you knew the n8n user (e.g., 'node' or 'n8n'), you could add: USER n8n_user
|
| 24 |
-
# For now, let's assume the n8n image handles user context correctly for its main process.
|
| 25 |
-
# If the image has a specific non-root user set by default (e.g. 'node'),
|
| 26 |
-
# it might be good to revert to it:
|
| 27 |
-
# USER node
|
| 28 |
-
# However, the n8n base image should handle its runtime user context correctly after this.
|
| 29 |
|
| 30 |
# Expose the port. Hugging Face Spaces will use this port based on the README.md app_port metadata.
|
| 31 |
EXPOSE 7860
|
| 32 |
|
| 33 |
-
# Set
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
ENV GENERIC_TIMEZONE="UTC"
|
| 9 |
# ENV N8N_DIAGNOSTICS_ENABLED=false
|
| 10 |
|
| 11 |
+
# Tell n8n to automatically enforce correct permissions for its settings file
|
| 12 |
+
ENV N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
|
| 13 |
|
| 14 |
+
# Create a working directory (good practice, though n8n uses /home/node/.n8n for data)
|
| 15 |
+
WORKDIR /app
|
| 16 |
|
| 17 |
+
# Copy the startup script into the container and set its permissions.
|
| 18 |
+
# Using an absolute path for the destination is a bit more robust.
|
| 19 |
+
COPY --chmod=0755 start.sh /app/start.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
# Expose the port. Hugging Face Spaces will use this port based on the README.md app_port metadata.
|
| 22 |
EXPOSE 7860
|
| 23 |
|
| 24 |
+
# Set our start.sh script as the entrypoint.
|
| 25 |
+
# This script is responsible for setting up necessary environment variables
|
| 26 |
+
# and then executing the main n8n process.
|
| 27 |
+
ENTRYPOINT ["/app/start.sh"]
|
| 28 |
+
|
| 29 |
+
# CMD is not strictly needed here if start.sh takes no arguments,
|
| 30 |
+
# or you can leave it as CMD [] if you prefer.
|
| 31 |
+
# The base n8n image's CMD would be overridden by this ENTRYPOINT.
|