mirror of
https://github.com/narrrl/holy-flavor-rater.git
synced 2026-11-03 16:41:27 +01:00
fixed build error
This commit is contained in:
1 parent
61f0aadc70
commit
0b12917a09
2 files changed
+18
-3
No files matched your search
@@ -1,2 +1,6 @@
|
||||
/target
|
||||
.env
|
||||
|
||||
# Not vendored: the embedded common-passwords list is fetched at build time
|
||||
# (see Dockerfile). A local copy lives here only for native `cargo build` dev.
|
||||
/assets
|
||||
+14
-3
@@ -7,7 +7,7 @@ WORKDIR /build
|
||||
# reqwest uses rustls (no OpenSSL), but pkg-config/ca-certs are still handy for
|
||||
# the build; sqlite is bundled via libsqlite3-sys, no system lib needed.
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends pkg-config ca-certificates \
|
||||
&& apt-get install -y --no-install-recommends pkg-config ca-certificates curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Cache dependencies separately from source: copy manifests, build a stub, then
|
||||
@@ -17,9 +17,20 @@ RUN mkdir src && echo 'fn main() {}' > src/main.rs \
|
||||
&& cargo build --release \
|
||||
&& rm -rf src
|
||||
|
||||
# Real sources (assets/ carries the embedded common-passwords list).
|
||||
# Fetch the common-passwords list at build time instead of vendoring it in git.
|
||||
# It's Django 5.2's `common-passwords.txt.gz`, embedded via include_bytes! in
|
||||
# src/password_policy.rs. The checksum is verified, so an upstream change (or a
|
||||
# moved branch ref) fails the build loudly rather than silently shipping a
|
||||
# different list. Bump the tag + DJANGO_PASSWORDS_SHA256 together to update it.
|
||||
ARG DJANGO_PASSWORDS_TAG=5.2
|
||||
ARG DJANGO_PASSWORDS_SHA256=3c1baed62596de36860824eb3f436d5932d37ca8b06e59df78f5a44ec175afe4
|
||||
RUN mkdir -p assets \
|
||||
&& curl -fsSL -o assets/common-passwords.txt.gz \
|
||||
"https://raw.githubusercontent.com/django/django/${DJANGO_PASSWORDS_TAG}/django/contrib/auth/common-passwords.txt.gz" \
|
||||
&& echo "${DJANGO_PASSWORDS_SHA256} assets/common-passwords.txt.gz" | sha256sum -c -
|
||||
|
||||
# Real sources.
|
||||
COPY src ./src
|
||||
COPY assets ./assets
|
||||
# Touch so cargo sees main.rs as newer than the stub build above.
|
||||
RUN touch src/main.rs && cargo build --release \
|
||||
&& strip target/release/holy_backend_rs
|
||||
|
||||
Reference in new issue
Block a user