Files
palette/Dockerfile
T
poslop 4f1e901f04
CI / test (push) Successful in 19s
CI / docker (push) Failing after 2m7s
Refactor: split monolith into cmd/palette + internal/{store,api,web,lang} (#35)
2026-09-09 01:33:39 -05:00

35 lines
657 B
Docker

# syntax=docker/dockerfile:1
# ---- build stage ----
FROM golang:1.27-alpine AS build
WORKDIR /src
# cache deps first
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /palette ./cmd/palette
# ---- runtime stage ----
FROM alpine:3.20
# non-root user
RUN adduser -D -u 10001 palette
COPY --from=build /palette /usr/local/bin/palette
USER palette
WORKDIR /data
ENV PALETTE_ADDR=":8080" \
PALETTE_DB="/data/palette.db"
EXPOSE 8080
VOLUME /data
HEALTHCHECK --interval=30s --timeout=3s --retries=3 \
CMD wget -qO- http://127.0.0.1:8080/ >/dev/null 2>&1 || exit 1
ENTRYPOINT ["palette"]