mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-11-14 08:17:26 +01:00
Backend, scripts, docs and their tests take main's newer code where both sides changed the same lines (the shared blob cache, GitHubStream and markdown fixes landed on main after the Go migration branch was cut). The Dockerfile keeps the Go build from the migration, plus main's owner-alert-protocol label; .gitignore keeps both sides' entries. Frontend keeps the redesign and folds in main's features: Stripe billing in the New anonymization submit bar, GitHub access repair, redaction syntax help, the preview expand toggle, configurable redaction mask, folder counts, reviewer-route header rules, link expiry (now in the viewer's snapshot details) and the explorer error card. main's narrow-only wrap logic is dropped because the redesign wraps on desktop and scrolls sideways on phones. Tests: 1534 passing with SESSION_SECRET set (as in CI). Three main tests were updated for the agreed viewer design (no site header in the viewer, no repository-wide file count). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
30 lines
1.4 KiB
Docker
30 lines
1.4 KiB
Docker
# syntax=docker/dockerfile:1.7
|
|
FROM node:24-slim AS assets
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json gulpfile.js ./
|
|
RUN --mount=type=cache,target=/root/.npm npm ci --no-audit --fund=false
|
|
COPY public ./public
|
|
COPY src ./src
|
|
RUN npm run build:ui
|
|
|
|
FROM golang:1.27.3-bookworm AS build
|
|
WORKDIR /src
|
|
COPY backend/go.mod backend/go.sum ./
|
|
RUN --mount=type=cache,target=/go/pkg/mod go mod download
|
|
COPY backend ./
|
|
RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /anonymous-server ./cmd/server
|
|
|
|
FROM debian:bookworm-slim
|
|
LABEL science.4open.owner-alert-protocol="recipient-v2"
|
|
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/* && useradd --uid 10001 --create-home anonymous
|
|
WORKDIR /app
|
|
COPY --from=build /anonymous-server /usr/local/bin/anonymous-server
|
|
COPY --from=build /src/licenses /usr/share/licenses/anonymous-github
|
|
COPY --from=assets --chown=10001:10001 /app/public ./public
|
|
RUN mkdir /app/repositories && chown 10001:10001 /app/repositories
|
|
USER 10001:10001
|
|
ENV PORT=5000 PUBLIC_DIR=/app/public FOLDER=/app/repositories COOKIE_SECURE=true GOMEMLIMIT=768MiB
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s CMD ["/usr/local/bin/anonymous-server", "healthcheck"]
|
|
EXPOSE 5000
|
|
ENTRYPOINT ["/usr/local/bin/anonymous-server"]
|