simpleproxy/Dockerfile
Merith f73095ed36
All checks were successful
Build Docker Image on Commit / build-and-publish (push) Successful in 1m0s
fix buildfile hardcoded arch
2025-07-16 21:09:30 +00:00

28 lines
579 B
Docker

# Build Stage
FROM golang:1.22-alpine AS builder
WORKDIR /app
# Install dependencies
RUN apk add --no-cache git
# Copy go modules and download dependencies
COPY go.mod go.sum ./
RUN go mod download
# Copy source files
COPY ./cmd/simpleproxy ./cmd/simpleproxy
# Build the binary with optimizations
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /app/simpleproxy ./cmd/simpleproxy
# Final Minimal Image
FROM alpine:latest
WORKDIR /root/
# Copy the compiled binary from the builder stage
COPY --from=builder /app/simpleproxy .
# Run the binary
ENTRYPOINT ["./simpleproxy"]