n8n / Dockerfile
derek-thomas's picture
Pinning version
4c1df9d verified
raw
history blame
683 Bytes
# Use the official n8n Docker image as the base image
FROM docker.n8n.io/n8nio/n8n@sha256:9caf109e2293557568ab687b9d6c82646250c8ab7dcb20479c8bef9956811b7a
# Use the secret securely during the build process
RUN --mount=type=secret,id=N8N_AUTH_PASSWORD,mode=0444,required=true \
export N8N_BASIC_AUTH_PASSWORD=$(cat /run/secrets/N8N_AUTH_PASSWORD)
# Set environment variables for n8n
ENV GENERIC_TIMEZONE="Asia/Dubai" \
TZ="Asia/Dubai" \
N8N_BASIC_AUTH_ACTIVE="true" \
N8N_BASIC_AUTH_USER="admin"
# Set the working directory
WORKDIR /data
# Expose port 5678 (default port for n8n)
EXPOSE 5678
# Command to run n8n
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]