Update Dockerfile
Browse files- Dockerfile +11 -6
Dockerfile
CHANGED
|
@@ -3,14 +3,9 @@
|
|
| 3 |
FROM n8nio/n8n:latest
|
| 4 |
|
| 5 |
# Set environment variables for n8n
|
| 6 |
-
# N8N_HOST tells n8n to bind to all available network interfaces within the container.
|
| 7 |
ENV N8N_HOST="0.0.0.0"
|
| 8 |
-
# N8N_PORT tells n8n which port to listen on. Hugging Face Spaces requires 7860.
|
| 9 |
ENV N8N_PORT=7860
|
| 10 |
-
# Optional: Set your timezone. Replace "UTC" with your desired timezone, e.g., "Europe/Berlin".
|
| 11 |
-
# A list of tz database time zones can be found here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
| 12 |
ENV GENERIC_TIMEZONE="UTC"
|
| 13 |
-
# Disable telemetry if you prefer
|
| 14 |
# ENV N8N_DIAGNOSTICS_ENABLED=false
|
| 15 |
|
| 16 |
# Create a working directory
|
|
@@ -18,12 +13,22 @@ WORKDIR /app
|
|
| 18 |
|
| 19 |
# Copy the startup script into the container
|
| 20 |
COPY start.sh .
|
|
|
|
|
|
|
|
|
|
| 21 |
# Make the startup script executable
|
| 22 |
RUN chmod +x ./start.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
# Expose the port. Hugging Face Spaces will use this port based on the README.md app_port metadata.
|
| 25 |
EXPOSE 7860
|
| 26 |
|
| 27 |
# Set the startup script as the command to run when the container starts.
|
| 28 |
-
# This script will configure WEBHOOK_URL using SPACE_HOST and then execute n8n.
|
| 29 |
CMD ["./start.sh"]
|
|
|
|
| 3 |
FROM n8nio/n8n:latest
|
| 4 |
|
| 5 |
# Set environment variables for n8n
|
|
|
|
| 6 |
ENV N8N_HOST="0.0.0.0"
|
|
|
|
| 7 |
ENV N8N_PORT=7860
|
|
|
|
|
|
|
| 8 |
ENV GENERIC_TIMEZONE="UTC"
|
|
|
|
| 9 |
# ENV N8N_DIAGNOSTICS_ENABLED=false
|
| 10 |
|
| 11 |
# Create a working directory
|
|
|
|
| 13 |
|
| 14 |
# Copy the startup script into the container
|
| 15 |
COPY start.sh .
|
| 16 |
+
|
| 17 |
+
# Switch to root to change permissions
|
| 18 |
+
USER root
|
| 19 |
# Make the startup script executable
|
| 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 the startup script as the command to run when the container starts.
|
|
|
|
| 34 |
CMD ["./start.sh"]
|