mirror of
https://github.com/warmbly/warmbly.git
synced 2026-09-04 16:02:01 +00:00
28 lines
593 B
Docker
28 lines
593 B
Docker
# Build stage
|
|
FROM golang:1.24-alpine AS builder
|
|
|
|
RUN apk add --no-cache git ca-certificates
|
|
|
|
WORKDIR /app
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /backend ./cmd/backend
|
|
|
|
# Runtime stage
|
|
FROM alpine:3.19
|
|
|
|
RUN apk add --no-cache ca-certificates tzdata
|
|
RUN adduser -D -u 1000 warmbly
|
|
|
|
COPY --from=builder /backend /app/backend
|
|
|
|
USER warmbly
|
|
EXPOSE 8080
|
|
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s \
|
|
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health || exit 1
|
|
|
|
ENTRYPOINT ["/app/backend"]
|