mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
Go 1.26.10 and 1.27.3 make crypto/x509 reject chains that pass through the compromised eMudhra intermediate CAs. Go 1.25 has no backport, so binaries built from go.mod 1.25.5 would still trust forged certificates from those intermediates on systems whose trust store has not been updated. skillshare makes HTTPS requests for upgrade, update checks, search and registry lookups, so release binaries need the fix. Move go.mod, mise.toml, the three Docker images and the sandbox docs to 1.26.10. CI and release builds follow go.mod through go-version-file.
37 lines
1.3 KiB
Docker
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.26.10
|
|
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
|