Docker release / docker (push) Failing after 26s
- Bump the builder image to golang:1.25-alpine to match go.mod's "go 1.25.0" requirement — the previous 1.22 base failed to build at all. - Stop COPYing the git-ignored config.yaml (which doesn't exist in a fresh checkout, breaking CI/release builds); ship config.example.yaml as the image's default instead, same as it's already overridden via a volume mount in docker-compose.yaml. - Build and include the nidusctl binary in the runtime image so users can create their first user/calendars/address books straight from a running container via `docker compose exec`, without installing Go. - README: document that Docker workflow, mention the pre-built multi-arch images published by the new release CI, and drop the "Client configuration" section — how to configure a given DAV client is out of scope for this project's docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
31 lines
909 B
Docker
31 lines
909 B
Docker
# ---- Build stage ----
|
|
FROM golang:1.25-alpine AS builder
|
|
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /bin/davserver ./cmd/server
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /bin/nidusctl ./tools/nidusctl
|
|
|
|
# ---- Runtime stage ----
|
|
FROM alpine:3.19
|
|
|
|
RUN apk add --no-cache ca-certificates tzdata
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /bin/davserver /usr/local/bin/davserver
|
|
COPY --from=builder /bin/nidusctl /usr/local/bin/nidusctl
|
|
|
|
# Default data and config locations
|
|
VOLUME ["/app/data"]
|
|
# config.yaml itself is git-ignored (it holds real secrets), so the image
|
|
# ships the example config as a working default; mount your own
|
|
# config.yaml over /app/config.yaml (see docker-compose.yaml) to override it.
|
|
COPY config.example.yaml /app/config.yaml
|
|
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["davserver", "-config", "/app/config.yaml"]
|