1
Fork 0
mirror of https://github.com/thegeneralist01/archivr synced 2026-07-21 18:55:36 +02:00

fix: third round of Docker review issues

Rust toolchain (P1):
- Dockerfile: bump builder from rust:1.87 to rust:1.88; time@0.3.51,
  time-core@0.1.9, and time-macros@0.2.30 (present in Cargo.lock) all
  require MSRV 1.88, so the real cargo build --release step was failing

single-file-cli wait mode (P2):
- singlefile.rs: replace --browser-wait-until=networkidle2 with
  networkAlmostIdle; the single-file-cli option only accepts
  InteractiveTime/networkIdle/networkAlmostIdle/load/domContentLoaded
  (verified in options.js); networkidle2 is a Puppeteer concept that the
  CLI does not recognise, causing silent fallback to the earliest state
  and incomplete captures. networkAlmostIdle is the closest equivalent
  (<=2 open connections, matching Puppeteer's networkidle2 semantics)

Build context size (P3):
- .dockerignore: add target/, frontend/node_modules/, frontend/dist/;
  these can reach 1.4G+ after a local dev build and are never read by
  the Dockerfile, so sending them to the builder wastes time and memory
This commit is contained in:
TheGeneralist 2026-06-30 14:35:08 +02:00
parent 93dea9ffbf
commit 1e28e1c613
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
3 changed files with 9 additions and 3 deletions

View file

@ -7,3 +7,9 @@ docker/
# Development and VCS noise # Development and VCS noise
.git/ .git/
.gitignore .gitignore
# Generated build outputs — can be 1.4G (target/) and 243M (node_modules/)
# after a local dev build; exclude them to keep the build context small.
target/
frontend/node_modules/
frontend/dist/

View file

@ -3,7 +3,7 @@
############################################################################### ###############################################################################
# Stage 1 Build the Rust server and CLI binaries # Stage 1 Build the Rust server and CLI binaries
############################################################################### ###############################################################################
FROM rust:1.87-slim-bookworm AS builder FROM rust:1.88-slim-bookworm AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config \ pkg-config \

View file

@ -90,8 +90,8 @@ fn save_with(
.arg(&out_file) .arg(&out_file)
.arg(format!("--browser-executable-path={chrome}")) .arg(format!("--browser-executable-path={chrome}"))
.arg("--browser-headless") .arg("--browser-headless")
.arg("--browser-wait-until=networkidle2") .arg("--browser-wait-until=networkAlmostIdle")
// Extra delay after networkidle2: Cloudflare Fonts injects @font-face // Extra delay after networkAlmostIdle: Cloudflare Fonts injects @font-face
// CSS after HTML parse, so the font hook needs more time to see it. // CSS after HTML parse, so the font hook needs more time to see it.
.arg("--browser-wait-delay=2000") .arg("--browser-wait-delay=2000")
// Realistic UA: some origins block headless Chrome's default UA string. // Realistic UA: some origins block headless Chrome's default UA string.