rd13_tile_server/services/marker-api/Dockerfile

21 lines
938 B
Text
Raw Permalink Normal View History

# ── Stage 1: Build ──────────────────────────────────────────────────────────
FROM golang:1.21-alpine AS builder
WORKDIR /build
COPY go.mod main.go ./
# Statisch gelinkt, minimales Binary (~5 MB)
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o marker-api .
# ── Stage 2: Run ─────────────────────────────────────────────────────────────
# alpine:3.19 ≈ 8 MB Basis, wget für Healthcheck
FROM alpine:3.19
RUN apk add --no-cache wget
COPY --from=builder /build/marker-api /usr/local/bin/marker-api
EXPOSE 3000
ENV PORT=3000
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD wget -qO- http://localhost:3000/health || exit 1
ENTRYPOINT ["marker-api"]