diff --git a/Dockerfile b/Dockerfile index 1d710bd380..330ef65d43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,6 +33,16 @@ RUN set -eu; \ trunk --version WORKDIR /src +# The interface translations at the commit in craft-i18n.rev (crates/ui-egui/build.rs), as CI and +# releases embed them; without them the build would be English only. +COPY craft-i18n.rev ./ +RUN set -eu; \ + rev="$(tr -d '[:space:]' < craft-i18n.rev)"; \ + mkdir -p /opt/craft-i18n; \ + curl --proto '=https' -fsSL --retry 3 -A Photocraft-dev "https://codeload.github.com/storytold/craft-i18n/tar.gz/$rev" \ + | tar -xz --strip-components=1 -C /opt/craft-i18n; \ + test -d /opt/craft-i18n/locales +ENV CRAFT_I18N_DIR=/opt/craft-i18n CRAFT_I18N_REQUIRED=1 COPY . . WORKDIR /src/apps/photocraft-web # Docker serving has no static-host per-file size cap. Thin LTO uses less build diff --git a/packaging/web/README.md b/packaging/web/README.md index 1f62de0a90..37d9b88e4f 100644 --- a/packaging/web/README.md +++ b/packaging/web/README.md @@ -43,7 +43,9 @@ the default Rust version is the stable release CI used when the `Dockerfile` was `TRUNK_VERSION`. `RUST_VERSION`, `TRUNK_VERSION`, and `NGINX_VERSION` can be overridden with `--build-arg`. To stamp the About dialog with the commit and date instead of "dev build", pass `--build-arg PHOTOCRAFT_BUILD_SHA=$(git rev-parse HEAD) --build-arg PHOTOCRAFT_BUILD_DATE=$(date -u +%F)`. -The web build does not embed the optional `craft-fonts` checkout. +It downloads the interface translations from +[storytold/craft-i18n](https://github.com/storytold/craft-i18n) at the commit in `craft-i18n.rev`, +as CI and releases do. The web build does not embed the optional `craft-fonts` checkout. The Docker build uses thin LTO and one Cargo build job to reduce peak memory, while keeping the web profile's size optimizations and `wasm-opt -Oz`. Its Wasm size may differ from the