qkeeper/Dockerfile
Aleksandr Berkuta 5806fe84c4 init commit
2026-03-27 20:27:56 +03:00

19 lines
465 B
Docker

# Stage 1: build
FROM golang:1.22-alpine AS builder
WORKDIR /app
# Cache dependency downloads separately from source changes.
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o queue .
# Stage 2: minimal runtime image
# alpine (not scratch) so the filesystem supports the bbolt DB file at /data.
FROM alpine:3.19
RUN mkdir -p /data
COPY --from=builder /app/queue /queue
EXPOSE 8080
ENTRYPOINT ["/queue"]