FROM golang:1.21-alpine AS builder # Install build dependencies RUN apk add --no-cache git make # Set working directory WORKDIR /app # Copy go mod files COPY repo/go.mod repo/go.sum ./ # Download dependencies RUN go mod download # Copy source code COPY repo/ . # Build application RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o webhook # Final stage FROM cloudron/base:3.2.0 # Copy binary from builder COPY --from=builder /app/webhook /usr/local/bin/webhook # Create data directory RUN mkdir -p /app/data # Set permissions RUN chmod +x /usr/local/bin/webhook # Set working directory WORKDIR /app # Expose port EXPOSE 9000 # Start application CMD ["/usr/local/bin/webhook", "-hooks", "/app/data/hooks.json", "-verbose"]