Skip to content

Instantly share code, notes, and snippets.

@bolhasec
Created April 18, 2025 14:42
Show Gist options
  • Select an option

  • Save bolhasec/5e4e72913d8aa0260a5efcc0b682eb4e to your computer and use it in GitHub Desktop.

Select an option

Save bolhasec/5e4e72913d8aa0260a5efcc0b682eb4e to your computer and use it in GitHub Desktop.
Coolify N8N Dockerfile
FROM n8nio/n8n:latest
# Switch to root user to install packages and modify system directories
USER root
# Install necessary system packages using apk
# build-base, python3-dev, geoip-dev are needed for potential native dependencies
# wget for downloading, git for source control (might be needed by Go), bash (useful shell)
RUN apk update && \
apk add --no-cache \
wget
# Set Go version as an argument (can be overridden during build)
ARG GOLANG_VERSION=1.23.8
# Install Go
RUN wget https://go.dev/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go${GOLANG_VERSION}.linux-amd64.tar.gz && \
rm go${GOLANG_VERSION}.linux-amd64.tar.gz
# Set Go environment variables persistently for subsequent RUN commands and the final image
ENV PATH="/usr/local/go/bin:${PATH}"
ENV GOPATH=/go
# Create GOPATH directory and set permissions if needed (though go install often handles this)
RUN mkdir -p ${GOPATH}/bin ${GOPATH}/pkg ${GOPATH}/src && \
chmod -R 777 ${GOPATH}
# Install subfinder using Go
# Move the installed binary to a standard location in PATH
# Clean up Go build cache afterwards to reduce image size
RUN go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest && \
mv ${GOPATH}/bin/subfinder /usr/local/bin/ && \
rm -rf ${GOPATH}/pkg/* ${GOPATH}/src/*
# Install subfinder
RUN go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest && \
mv /go/bin/subfinder /usr/local/bin/
# Confirm install
RUN subfinder -version
# Install nuclei
RUN go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest && \
mv /go/bin/nuclei /usr/local/bin/
# Confirm install
RUN nuclei -version && nuclei
# Install Trufflehog
RUN git clone https://github.com/trufflesecurity/trufflehog.git
RUN cd trufflehog; go install
RUN cp /go/bin/trufflehog /usr/local/bin/
# Switch back to the non-root user that n8n runs as (typically 'node')
USER node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment