Files
skillshare/docker/production/Dockerfile
T
Willie 1fe668ec54 ci(release): add reviewed version PRs and manual publication
Create Release Please PRs, synchronize release metadata, and test the exact merge commit before tagging and building an unpublished draft.

Verify release artifacts before manual publication and keep Homebrew and Docker distribution tied to the approved version. Document explicit version overrides and squash-merge behavior in the release skills and runbook.

Validation: make check, 12 release helper tests, actionlint, and an isolated six-platform GoReleaser build with artifact verification.
2026-10-02 01:53:47 +08:00

37 lines
1.3 KiB
Docker

# Production Dockerfile — lightweight single-binary image
# Build: docker build -f docker/production/Dockerfile -t skillshare .
# Stage 1: Build Go binary
ARG GO_VERSION=1.25.5
FROM golang:${GO_VERSION}-bookworm AS go-builder
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG TARGETARCH=amd64
ARG VERSION=dev
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go build -trimpath -ldflags="-s -w -X main.version=${VERSION}" -o /skillshare ./cmd/skillshare
# Stage 2: Minimal runtime
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
bash git ca-certificates curl tini && \
rm -rf /var/lib/apt/lists/*
RUN useradd -r -u 10001 -s /usr/sbin/nologin skillshare && \
mkdir -p /home/skillshare/.config/skillshare && \
chown -R 10001:10001 /home/skillshare
COPY --from=go-builder /skillshare /usr/local/bin/skillshare
COPY docker/production/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
USER 10001
ENV HOME=/home/skillshare
WORKDIR /home/skillshare
EXPOSE 19420
ENTRYPOINT ["tini", "--", "/entrypoint.sh"]
CMD ["skillshare", "ui", "-g", "--host", "0.0.0.0", "--no-open"]
HEALTHCHECK --interval=10s --timeout=5s --retries=3 --start-period=10s \
CMD curl -sf http://localhost:19420/api/health || exit 1