mirror of
https://github.com/tiennm99/noitu.git
synced 2026-10-11 03:13:45 +00:00
build: drop the fixture dictionary option from the image
This commit is contained in:
1 parent
f37e3e69f4
commit
f7509720fe
2 files changed
+1
-18
No files matched your search
+1
-14
@@ -37,23 +37,10 @@ RUN CGO_ENABLED=0 go build -trimpath -o /out/build-dictionary ./cmd/build-dictio
|
||||
# --- the dictionary ---------------------------------------------------------
|
||||
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
|
||||
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
|
||||
|
||||
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
|
||||
RUN mkdir -p /out && build-dictionary --corpus ./dictionary.txt --out /out/noitu.db
|
||||
|
||||
# --- the image --------------------------------------------------------------
|
||||
FROM gcr.io/distroless/static-debian12:nonroot
|
||||
|
||||
@@ -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
|
||||
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
|
||||
|
||||
`GET /version` answers with the build's version, and the same string opens
|
||||
|
||||
Reference in new issue
Block a user