1# mosaic: the Go engine and the Deno/Fresh site in one image. Generation2# and judging run as subprocesses of the site; the daily loop runs3# in-process (MOSAIC_DAILY=1) with everything persistent under /data.45# --- engine ---------------------------------------------------------------6FROM golang:1.25-bookworm AS engine7WORKDIR /src/engine8COPY engine/go.mod engine/go.sum ./9COPY engine/ ./10ENV CGO_ENABLED=011RUN go build -trimpath -ldflags="-s -w" -o /out/mosaic-engine .1213# --- site -----------------------------------------------------------------14FROM denoland/deno:2.9.5 AS site15WORKDIR /app/site16COPY site/deno.json site/deno.lock ./17RUN deno install18COPY site/ ./19RUN deno task build2021# --- runtime --------------------------------------------------------------22FROM denoland/deno:2.9.523WORKDIR /app/site24COPY --from=engine /out/mosaic-engine /app/engine/bin/mosaic-engine25COPY --from=site /app/site /app/site26ENV MOSAIC_ENGINE=/app/engine/bin/mosaic-engine \27 MOSAIC_DATA=/data/ \28 MOSAIC_DAILY=1 \29 MOSAIC_PUBLIC=1 \30 PORT=808031VOLUME ["/data"]32EXPOSE 808033# warm the module cache so the first request is not a cold compile34RUN deno cache _fresh/server.js || true35CMD ["sh", "-c", "mkdir -p /data && exec deno serve -A --host 0.0.0.0 --port ${PORT} _fresh/server.js"]