add github action, build script, docker ignore

This commit is contained in:
2026-02-12 22:21:53 -08:00
parent 08e7cc5c45
commit d2c0600359
4 changed files with 54 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
FROM golang:1.23-bookworm AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# Buildx automatically injects TARGETARCH, TARGETOS, and TARGETPLATFORM as build args into the Dockerfile
ARG TARGETARCH
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -o go-weather .
FROM gcr.io/distroless/static-debian12
COPY --from=builder /app/go-weather /go-weather
EXPOSE 8080
ENTRYPOINT ["/go-weather"]