forked from mtusi2026/mtusi2026lab3
Implement lab 3 level 4 failover and idempotency
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
FROM golang:1.27.1-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY cmd/migrate/ ./cmd/migrate/
|
||||
COPY db/migrations/ ./db/migrations/
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -o /app/migrate ./cmd/migrate
|
||||
|
||||
FROM alpine:3.22
|
||||
|
||||
RUN addgroup -S app && adduser -S app -G app
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/migrate ./migrate
|
||||
|
||||
USER app
|
||||
ENTRYPOINT ["/app/migrate"]
|
||||
Reference in New Issue
Block a user