Dockerfile, Gitea Actions CI workflow, README with API docs
CI / test (push) Successful in 1m14s
CI / docker (push) Skipped

This commit is contained in:
2026-09-08 17:00:36 -05:00
parent c6233dbbec
commit 6a08034b4c
3 changed files with 200 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
# 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 .
# ---- 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"]