mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-01-10 06:48:04 -05:00
Update Go version across Dockerfile, Nix configurations, and Go modules. Refresh dependencies and Nix flake inputs. CHANGES: * Update Go version to 1.24.2 in Dockerfile. * Set Go version to 1.24.0 and toolchain to 1.24.2. * Refresh Go module dependencies and sums (go.mod, go.sum). * Update Nix flake lock file inputs. * Configure Nix environment and packages for Go 1.24. * Update gomod2nix lock file with dependency hashes. * Use Go 1.24 in Nix development shell environment.
42 lines
809 B
Docker
42 lines
809 B
Docker
# Use official golang image as builder
|
|
FROM golang:1.24.2-alpine AS builder
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy go mod and sum files
|
|
COPY go.mod go.sum ./
|
|
|
|
# Download dependencies
|
|
RUN go mod download
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the application
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -o fabric
|
|
|
|
# Use scratch as final base image
|
|
FROM alpine:latest
|
|
|
|
# Copy the binary from builder
|
|
COPY --from=builder /app/fabric /fabric
|
|
|
|
# Copy patterns directory
|
|
COPY patterns /patterns
|
|
|
|
# Ensure clean config directory and copy ENV file
|
|
RUN rm -rf /root/.config/fabric && \
|
|
mkdir -p /root/.config/fabric
|
|
COPY ENV /root/.config/fabric/.env
|
|
|
|
# Add debug commands
|
|
RUN ls -la /root/.config/fabric/
|
|
|
|
# Expose port 8080
|
|
EXPOSE 8080
|
|
|
|
# Run the binary with debug output
|
|
ENTRYPOINT ["/fabric"]
|
|
CMD ["--serve"]
|