fix the fucky wucky

This commit is contained in:
2025-02-28 21:13:36 +00:00
parent dbe9e1a5a7
commit 3690935295
7 changed files with 43 additions and 17 deletions

View File

@@ -1,15 +1,17 @@
FROM golang:1.22.4 AS builder
FROM golang:1.24 AS builder
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -ldflags="-s -w" -o spotify-ws .
RUN go build -ldflags="-s -w" -o healthcheck healthcheck.go
FROM gcr.io/distroless/static:nonroot
WORKDIR /app
COPY --from=builder --chown=nonroot:nonroot /app/spotify-ws .
COPY --from=builder --chown=nonroot:nonroot /app/healthcheck .
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s CMD curl --fail http://localhost:3000/health || exit 1
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s CMD ["./healthcheck"]
USER nonroot:nonroot
CMD ["./spotify-ws"]