build: drop the fixture dictionary option from the image

This commit is contained in:
tiennm99 committed 2026-10-02 14:48:35 +07:00
1 parent f37e3e69f4
commit f7509720fe
2 files changed
+1 -18

No files matched your search

+1 -14
View File
@@ -37,23 +37,10 @@ RUN CGO_ENABLED=0 go build -trimpath -o /out/build-dictionary ./cmd/build-dictio
# --- the dictionary --------------------------------------------------------- # --- the dictionary ---------------------------------------------------------
FROM alpine:3 AS dict FROM alpine:3 AS dict
# Set to 1 to build from the checked-in word sample instead of the corpus.
# That produces a playable but tiny dictionary, and exists so the image can be
# smoke-tested against the same words the browser suite plays.
ARG FIXTURE_DICT=0
WORKDIR /work WORKDIR /work
COPY --from=build /out/build-dictionary /usr/local/bin/build-dictionary COPY --from=build /out/build-dictionary /usr/local/bin/build-dictionary
COPY testdata/fixture-words.txt ./fixture-words.txt
COPY data/dictionary.txt ./dictionary.txt COPY data/dictionary.txt ./dictionary.txt
RUN mkdir -p /out && build-dictionary --corpus ./dictionary.txt --out /out/noitu.db
RUN set -eu; \
mkdir -p /out; \
if [ "$FIXTURE_DICT" = "1" ]; then \
build-dictionary --words ./fixture-words.txt --out /out/noitu.db --min-words 150; \
else \
build-dictionary --corpus ./dictionary.txt --out /out/noitu.db; \
fi
# --- the image -------------------------------------------------------------- # --- the image --------------------------------------------------------------
FROM gcr.io/distroless/static-debian12:nonroot FROM gcr.io/distroless/static-debian12:nonroot
-4
View File
@@ -65,10 +65,6 @@ database the game uses in a builder stage, so it downloads nothing from
Wikimedia. Only the database is copied into the final image. The result is a Wikimedia. Only the database is copied into the final image. The result is a
distroless image of about 25 MB running as a non-root user. distroless image of about 25 MB running as a non-root user.
Passing `--build-arg FIXTURE_DICT=1` builds the same image against the
checked-in word sample instead. It produces a playable but tiny dictionary;
do not ship it.
### Version ### Version
`GET /version` answers with the build's version, and the same string opens `GET /version` answers with the build's version, and the same string opens