mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-19 08:51:41 +01:00
docker: embed the craft-i18n translations at craft-i18n.rev
COPY . . used to bring the in-repo catalogs; the builder now fetches the pinned craft-i18n commit and builds with CRAFT_I18N_DIR and CRAFT_I18N_REQUIRED=1, so the image is not English only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
667e83fd11
commit
015f3806ec
2 files changed
+13
-1
No files matched your search
+10
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user