hatch-surf/Dockerfile
Chris Anderson ad0e78c9c9
Some checks are pending
CI / go (push) Waiting to run
CI / docker (push) Waiting to run
CI / lint-go (push) Waiting to run
CI / lint-docs (push) Waiting to run
CI / check-paperclip (push) Waiting to run
Fix Docker build (golang:1.26-alpine), update env config for face service
2026-06-26 05:53:58 +02:00

25 lines
484 B
Docker

# syntax=docker/dockerfile:1
# ---- build stage ----
FROM golang:1.26-alpine AS build
WORKDIR /src
# Cache module downloads before copying source (layer caching).
COPY go.mod go.sum ./
RUN go mod download
COPY . ./
# Build a fully static binary (CGO disabled, no libc dependency).
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /bin/hatch ./cmd/hatch
# ---- run stage ----
FROM scratch
COPY --from=build /bin/hatch /bin/hatch
EXPOSE 8080
ENTRYPOINT ["/bin/hatch"]