Files
SpeedtestServer-test/Dockerfile

22 lines
466 B
Docker
Raw Normal View History

2026-02-22 23:47:58 +03:00
# Build stage
FROM golang:1.25-alpine AS builder
WORKDIR /app
COPY go.mod go.sum* ./
RUN go mod download 2>/dev/null || true
COPY *.go ./
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o speedtest-server .
# Runtime stage - distroless for minimal attack surface
FROM gcr.io/distroless/static-debian12:latest-amd64
WORKDIR /
COPY --from=builder /app/speedtest-server /speedtest-server
EXPOSE 8080
USER nonroot:nonroot
ENTRYPOINT ["/speedtest-server"]