feat:lab1-catchup

This commit is contained in:
Оля Мороз
2026-10-01 10:55:28 +03:00
parent 65003b6119
commit 9febc0bbe4
12 changed files with 672 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
# --- build stage ---
FROM golang:1.22-alpine AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY cmd/ ./cmd/
COPY src/ ./src/
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/messenger ./cmd/messenger
# --- runtime stage ---
FROM alpine:3.20
RUN adduser -D -H -u 10001 app
USER app
WORKDIR /app
COPY --from=build /out/messenger /app/messenger
EXPOSE 8080
ENV APP_HOST=0.0.0.0 APP_PORT=8080 APP_ENV=lab
HEALTHCHECK --interval=5s --timeout=3s --start-period=2s --retries=5 \
CMD wget -qO- http://127.0.0.1:8080/health/live >/dev/null 2>&1 || exit 1
ENTRYPOINT ["/app/messenger"]