Dockerfile 446 B raw
1
# syntax=docker/dockerfile:1
2
3
# --- build stage ---
4
FROM golang:1.25-alpine AS build
5
WORKDIR /src
6
7
# cache deps
8
COPY go.mod go.sum ./
9
RUN go mod download
10
11
# build
12
COPY . .
13
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /out/feeds .
14
15
# --- runtime stage ---
16
FROM gcr.io/distroless/static:nonroot
17
WORKDIR /app
18
COPY --from=build /out/feeds /app/feeds
19
20
ENV HOST=0.0.0.0 PORT=3000
21
EXPOSE 3000
22
USER nonroot:nonroot
23
ENTRYPOINT ["/app/feeds"]