Files
scrabble-game/renderer/Dockerfile
T
Ilia Denisov de5ab9186c
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 10s
CI / integration (pull_request) Successful in 21s
CI / ui (pull_request) Successful in 1m14s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m48s
feat(legal): bilingual (RU + EN) legal pages with a language + theme switcher
Add English versions of the privacy policy, EULA and offer (ui/legal/*_en.md) and render each legal page as one self-contained bilingual document: both language bodies plus a header language toggle and theme toggle (no back), a small inline ES5 script that switches language client-side (no reload, default Russian + persisted) and applies the theme (system default + persisted override) — mirroring the landing. The offer's English view transliterates the Russian product names spliced from the live catalog.

renderLegalHtml now takes both language sources; renderOffer splices the price list into both; the renderer bakes and reads the _en sources and pre-renders the static pages at boot. Also wrap the /offer/ contour probe in the same retry+timeout as the legal probe (the offer page is now bilingual and larger). Docs + renderer/ui tests updated.
2026-07-13 13:22:56 +02:00

34 lines
1.6 KiB
Docker

# renderer — the finished-game image-render sidecar: Node + skia-canvas running the SAME
# ui/src/lib/gameimage.ts the web client unit-tests, bundled at build time (renderer/README.md).
# Debian slim, not the repo's usual alpine/distroless: skia-canvas ships prebuilt glibc
# binaries and resolves fonts through fontconfig, and the runtime fonts are baked into the
# image — Liberation Sans (the UI font stack's Linux face) + Noto Color Emoji (the 🏆).
FROM node:22-slim AS build
WORKDIR /src/renderer
RUN corepack enable && corepack prepare pnpm@11.0.9 --activate
COPY renderer/package.json renderer/pnpm-lock.yaml renderer/pnpm-workspace.yaml ./
RUN pnpm install --frozen-lockfile
COPY renderer/build.mjs ./
COPY renderer/src ./src
COPY ui/src/lib /src/ui/src/lib
RUN pnpm run bundle
FROM node:22-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends fonts-liberation fonts-noto-color-emoji \
&& rm -rf /var/lib/apt/lists/*
ENV NODE_ENV=production
ARG VERSION=dev
ENV APP_VERSION=${VERSION}
WORKDIR /app
COPY --from=build /src/renderer/node_modules ./node_modules
COPY --from=build /src/renderer/dist ./dist
COPY renderer/src/server.mjs renderer/src/render.mjs renderer/src/offer.mjs renderer/src/legal.mjs ./src/
# The public legal pages: the owner-edited markdown, read once at boot. GET /offer/ also splices in
# the live price list fetched from the backend at request time; GET /privacy/ and GET /eula/ are
# static (no dynamic data).
COPY ui/legal/offer_ru.md ui/legal/offer_en.md ui/legal/privacy_ru.md ui/legal/privacy_en.md ui/legal/eula_ru.md ui/legal/eula_en.md ./legal/
USER node
EXPOSE 8090
CMD ["node", "src/server.mjs"]