mirror of
https://github.com/git-pkgs/proxy.git
synced 2026-11-09 15:49:16 -05:00
Bumps alpine from 3.24.1 to 3.24.2. --- updated-dependencies: - dependency-name: alpine dependency-version: 3.24.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
35 lines
663 B
Docker
35 lines
663 B
Docker
FROM --platform=$BUILDPLATFORM golang:1.26.7-alpine AS builder
|
|
|
|
WORKDIR /src
|
|
|
|
# Install build dependencies
|
|
RUN apk add --no-cache git
|
|
|
|
# Copy go mod files first for caching
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the binary for the target platform
|
|
ARG TARGETARCH
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -ldflags="-s -w" -o /proxy ./cmd/proxy
|
|
|
|
FROM alpine:3.24.2
|
|
|
|
RUN apk add --no-cache ca-certificates
|
|
|
|
COPY --from=builder /proxy /usr/local/bin/proxy
|
|
|
|
# Create non-root user
|
|
RUN adduser -D -u 1000 proxy
|
|
USER proxy
|
|
|
|
# Default data directory
|
|
WORKDIR /data
|
|
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["proxy"]
|
|
CMD ["serve"]
|