# The web bundle, built once and carried as an image. # # Two stages, and the seam between them is the point: the first is a whole # Flutter SDK and a Nim compiler, about a gigabyte of toolchain that exists # only to produce `flutter/build/web`; the second is that directory and a # python to serve it. What gets pushed to the registry, and what Modal pulls # on every cold start, is the small half. # # This is the one place in the tree where a build happens inside a Dockerfile # rather than in `just` or a Modal sandbox. It is deliberate: rickub is what # has a registry to push to -- and docker already authenticated to it -- while # an image is what Modal can deploy without rebuilding anything. The build itself is still `tools/toolchain.sh` -- the # same pinned Flutter and Nim as `just build web` -- so nothing about the # output depends on being in a container. FROM debian:13-slim AS build # The toolchain's own needs (git, because Flutter shells out to it against # its SDK checkout; the unpackers; ca-certificates for curl) and Nim's one # host dependency, a C compiler. No GTK here and no CMake: the Linux desktop # target wants those, and this is the web one. RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential ca-certificates curl git tar unzip xz-utils \ && rm -rf /var/lib/apt/lists/* WORKDIR /src COPY . . # The same two steps as `just build web`, inlined because `just` is not here # and is not worth an install for one call. The core is compiled to # JavaScript and copied into `flutter/web/` rather than into the output, # because `flutter build web` copies that directory into the bundle -- which # is what makes the page's `