- Add parsimony list, member, held, archive and queue subcommands over the REST API - Read the token only from PARSIMONY_API_TOKEN; take the URL from --url or PARSIMONY_URL - Print tables by default and JSON with --json - Add member import from a file or stdin, reporting failing lines and exiting non-zero - Require --yes for destructive commands - Add parsimony serve; keep the old -config invocation working - Run the CLI inside the container in the end-to-end test - Test every command against the real API handler; mutation checks over the CLI
27 lines
1 KiB
Docker
27 lines
1 KiB
Docker
FROM node:24 AS admin
|
|
WORKDIR /src/admin
|
|
COPY admin/package.json admin/package-lock.json ./
|
|
RUN npm ci
|
|
COPY admin/ ./
|
|
# The build writes into ../internal/adminui/dist
|
|
RUN mkdir -p /src/internal/adminui/dist && npm run build
|
|
|
|
FROM golang:1.27 AS build
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
COPY --from=admin /src/internal/adminui/dist ./internal/adminui/dist
|
|
RUN CGO_ENABLED=0 go build -o /parsimony ./cmd/parsimony && mkdir /data
|
|
|
|
# Run as the unprivileged "nonroot" user (uid 65532). /data is the only writable path:
|
|
# the database and its WAL files live there. A new named volume inherits this ownership;
|
|
# for a bind mount, make the host directory writable by uid 65532.
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
|
COPY --from=build /parsimony /parsimony
|
|
COPY --from=build --chown=65532:65532 /data /data
|
|
VOLUME /data
|
|
EXPOSE 2424 8080 8081
|
|
USER 65532:65532
|
|
# Mount the config read-only at /etc/parsimony/parsimony.yaml; keep "db: /data/parsimony.db" in it.
|
|
ENTRYPOINT ["/parsimony", "serve", "-config", "/etc/parsimony/parsimony.yaml"]
|