shared-sqs: Этапы 7+8 — Dockerfile, K8s manifests, Makefile

This commit is contained in:
Naeel
2026-04-09 13:16:58 +03:00
parent 073683250c
commit 2c9a2b2ebf
6 changed files with 136 additions and 25 deletions
+14 -25
View File
@@ -1,28 +1,17 @@
# build image
FROM golang:alpine as build
# Dockerfile — shared-sqs multi-stage build
# Updated: 2026-04-09
WORKDIR /go/src/github.com/Admiral-Piett/goaws
COPY ./app/ ./app/
COPY ./go.mod .
COPY ./go.sum .
RUN ls -la
RUN CGO_ENABLED=0 go test ./app/...
RUN go build -o goaws app/cmd/goaws.go
# release image
FROM alpine
WORKDIR /app
COPY --from=build /go/src/github.com/Admiral-Piett/goaws/goaws ./goaws
COPY app/conf/goaws.yaml ./conf/
FROM golang:1.22-alpine AS builder
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o shared-sqs app/cmd/goaws.go
FROM alpine:3.19
RUN apk --no-cache add ca-certificates
COPY --from=builder /build/shared-sqs /usr/local/bin/shared-sqs
EXPOSE 4100
HEALTHCHECK --interval=5s --timeout=3s --retries=3 \
CMD wget localhost:4100/health -q -O - > /dev/null
ENTRYPOINT ["./goaws"]
HEALTHCHECK --interval=10s --timeout=5s --retries=3 \
CMD wget -q -O - http://localhost:4100/health || exit 1
ENTRYPOINT ["shared-sqs"]