Files
stack/infra/gitea/Dockerfile
kert 16f3b43974
Some checks failed
CI / skinny-install (aco) (push) Successful in 1m12s
CI / skinny-install (api) (push) Successful in 30s
CI / skinny-install (bcda) (push) Successful in 36s
CI / skinny-install (bib) (push) Successful in 35s
CI / skinny-install (bls) (push) Successful in 27s
CI / skinny-install (ccw) (push) Successful in 32s
CI / skinny-install (cli) (push) Successful in 41s
CI / skinny-install (cms) (push) Successful in 37s
CI / skinny-install (conf) (push) Successful in 38s
CI / skinny-install (opps) (push) Successful in 33s
CI / skinny-install (perf) (push) Successful in 38s
CI / skinny-install (pfs) (push) Successful in 38s
CI / skinny-install (rex) (push) Successful in 34s
Deploy / build-scan-report (push) Failing after 46s
Infra CI / notebooks (push) Failing after 25s
Infra CI / zotero (push) Successful in 12s
Infra CI / docs (push) Failing after 16s
CI / lint-test (push) Failing after 11m2s
Infra CI / mc (push) Successful in 21s
Infra CI / api (push) Successful in 29s
Package Supply Chain / pkg-supply-chain (push) Failing after 41s
feat: full session — mail servers, comment pipeline, PRISMA fetch, email ingest
Mail: Maddy on DO (corwins.media+Resend, fhirworx.io+Postmark),
touchless/stateless/idempotent. Gitea SMTP via env_file. CMS inbox
at cmsupdates@mail.fhirworx.io with IMAP→bib poller.

Bib: regulations.gov v4 client, Federal Register discovery, 164K
comment backfill (running), IMAP email ingest, Zotero sync routing.

PRISMA: altcha PoW solver, CrossRef DOI resolution, 83/129 PDFs.
Zotero: schema parity, ops module, CLI, fail-fast guard.
CI: docs.Dockerfile COPY glob fix (tracks #341).
Infra: Gitea+marimo fhirworx themes, IOM/OIG modules.
2026-04-16 09:04:38 -04:00

97 lines
4.1 KiB
Docker

# syntax=docker/dockerfile:1.7
# =============================================================================
# Gitea with fhirworx theme compiled in.
#
# Clones go-gitea/gitea at the pinned tag, drops our theme CSS into
# web_src/css/themes/, then runs Gitea's own webpack+go build so the theme is
# baked into `bindata`. Runtime stage is the same alpine+dumb-init layout as
# the upstream rootless image.
# =============================================================================
ARG GITEA_VERSION=v1.25.4
# BUILD_TAG must be unique per build; defaults to current epoch when unset.
# Gitea uses main.Version to construct the `?v=...` query string on every
# asset URL. Without changing it, browsers cache theme-fhirworx.css for 6h
# (Cache-Control: max-age=21600) — so theme edits never reach the user
# until the URL key changes. Setting it per-build forces every cache layer
# (browser, CDN, Cloudflare) to refetch.
ARG BUILD_TAG
# ---- build stage ------------------------------------------------------------
FROM docker.io/library/golang:1.25-alpine3.22 AS build
ARG GITEA_VERSION
ARG BUILD_TAG
ENV GOPROXY=https://proxy.golang.org,direct \
GOSUMDB=sum.golang.org \
TAGS="bindata timetzdata sqlite sqlite_unlock_notify" \
CGO_ENABLED=1
RUN apk add --no-cache build-base git nodejs npm \
&& npm install -g pnpm@10
WORKDIR /src
RUN git clone --depth 1 --branch ${GITEA_VERSION} \
https://github.com/go-gitea/gitea.git . \
&& git log -1 --format='%H %s'
# Drop fhirworx theme into Gitea's theme dir before the frontend build so
# webpack/bindata pick it up.
COPY theme/theme-fhirworx.css web_src/css/themes/theme-fhirworx.css
COPY theme/theme-fhirworx-dark.css web_src/css/themes/theme-fhirworx-dark.css
# Replace Gitea's source SVGs with fhirworx branding. tools/generate-images.ts
# reads these to produce logo.svg/.png, favicon.svg/.png, apple-touch-icon.png,
# avatar_default.png — all baked into bindata.
COPY brand/logo.svg assets/logo.svg
COPY brand/favicon.svg assets/favicon.svg
# Full build. Order matters: deps → generate-images (uses our brand SVGs) →
# webpack frontend → go binary with bindata embedding everything in public/.
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.local/share/pnpm/store \
make deps-frontend \
&& make generate-images \
&& BUILD_TAG="${BUILD_TAG:-$(date +%s)}" \
&& export LDFLAGS="-X 'main.Version=${GITEA_VERSION}-fhirworx.${BUILD_TAG}'" \
&& echo "Building with version: ${GITEA_VERSION}-fhirworx.${BUILD_TAG}" \
&& make clean-all build LDFLAGS="${LDFLAGS}" \
&& go build contrib/environment-to-ini/environment-to-ini.go
# Upstream rootless overlay files (entrypoint, setup, gitea wrapper).
RUN chmod 755 docker/rootless/usr/local/bin/docker-entrypoint.sh \
docker/rootless/usr/local/bin/docker-setup.sh \
docker/rootless/usr/local/bin/gitea \
/src/gitea \
/src/environment-to-ini
# ---- runtime stage ----------------------------------------------------------
FROM docker.io/library/alpine:3.22
LABEL org.opencontainers.image.source="https://github.com/go-gitea/gitea"
LABEL fhirworx.theme="fhirworx"
EXPOSE 2222 3000
RUN apk add --no-cache bash ca-certificates dumb-init gettext git curl gnupg openssh-keygen \
&& addgroup -S -g 1000 git \
&& adduser -S -H -D -h /var/lib/gitea/git -s /bin/bash -u 1000 -G git git \
&& mkdir -p /var/lib/gitea /etc/gitea \
&& chown git:git /var/lib/gitea /etc/gitea
COPY --from=build /src/docker/rootless /
COPY --from=build --chown=root:root /src/gitea /app/gitea/gitea
COPY --from=build --chown=root:root /src/environment-to-ini /usr/local/bin/environment-to-ini
USER 1000:1000
ENV GITEA_WORK_DIR=/var/lib/gitea \
GITEA_CUSTOM=/var/lib/gitea/custom \
GITEA_TEMP=/tmp/gitea \
TMPDIR=/tmp/gitea \
GITEA_APP_INI=/etc/gitea/app.ini \
HOME=/var/lib/gitea/git
VOLUME ["/var/lib/gitea", "/etc/gitea"]
WORKDIR /var/lib/gitea
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/usr/local/bin/docker-entrypoint.sh"]
CMD []