mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 21:41:09 +02:00
All 4 Go services using shared-go now: 1. COPY packages/shared-go/ to /shared-go/ in builder 2. go mod edit -replace before go mod download (dep caching) 3. go mod edit -replace before go build (source rebuild) Docker builds verified locally for mana-search and mana-notify. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
25 lines
817 B
Docker
25 lines
817 B
Docker
FROM golang:1.25-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
COPY packages/shared-go/ /shared-go/
|
|
COPY services/mana-notify/go.mod services/mana-notify/go.sum ./
|
|
RUN go mod edit -replace github.com/manacore/shared-go=/shared-go && go mod download
|
|
|
|
COPY services/mana-notify/ .
|
|
RUN go mod edit -replace github.com/manacore/shared-go=/shared-go && \
|
|
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /mana-notify ./cmd/server
|
|
|
|
FROM alpine:3.21
|
|
|
|
RUN apk --no-cache add ca-certificates tzdata && \
|
|
addgroup -g 1000 mana && adduser -u 1000 -G mana -s /sbin/nologin -D mana
|
|
|
|
COPY --from=builder /mana-notify /usr/local/bin/mana-notify
|
|
|
|
USER mana
|
|
EXPOSE 3040
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
|
CMD wget -q --spider http://localhost:3040/health || exit 1
|
|
|
|
ENTRYPOINT ["mana-notify"]
|