Implement lab 3 level 4 failover and idempotency
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
FROM golang:1.27.1-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o /app/server ./cmd/api
|
||||
|
||||
|
||||
FROM alpine:3.22
|
||||
|
||||
RUN addgroup -S app && adduser -S app -G app
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/server ./server
|
||||
|
||||
USER app
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
HEALTHCHECK --interval=10s --timeout=3s --start-period=3s --retries=3 \
|
||||
CMD wget -q -O /dev/null http://127.0.0.1:8080/health/ready || exit 1
|
||||
|
||||
CMD ["./server"]
|
||||
Reference in New Issue
Block a user