19 lines
576 B
Docker
19 lines
576 B
Docker
# syntax=docker/dockerfile:1
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
FROM golang:1.22-alpine AS build
|
|
WORKDIR /src
|
|
COPY . .
|
|
# go mod tidy resolves dependencies from source imports — no go.sum needed at
|
|
# repo root for first-time users running `docker compose build`.
|
|
RUN go mod tidy && \
|
|
CGO_ENABLED=0 GOOS=linux go build \
|
|
-ldflags="-s -w" \
|
|
-o /out/birdwatch-relay \
|
|
.
|
|
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
|
COPY --from=build /out/birdwatch-relay /birdwatch-relay
|
|
USER nonroot:nonroot
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["/birdwatch-relay"]
|