Understand the Blockscout frontend container build and runtime lifecycle
mainThe Blockscout frontend container is built using a three-stage Dockerfile (deps → builder → runner) and is initialized via entrypoint.sh.
Build Time
During the build phase, orchestration scripts in deploy/scripts/ prepare the application:
build_sprite.sh: Assembles SVG icons fromsrc/sprite/icons/intopublic/icons/sprite.<hash>.svg. The hash is exported asNEXT_PUBLIC_ICON_SPRITE_HASHfor cache-busting.collect_envs.sh: Scansdocs/ENVS.mdforNEXT_PUBLIC_*variables and creates.env.registry. This registry acts as a contract; only variables listed here are exposed to the browser. It also captures build arguments (Git tag, commit SHA, etc.) into.env.- Next.js Build: Runs
pnpm routes:generateandpnpm run buildto produce the standalone server bundle.
Runtime
When the container starts, entrypoint.sh executes a sequence of steps to configure the environment before handing control to the Next.js server (node server.js). These steps include loading presets, downloading external assets, validating environment variables, generating favicons/OG images, and generating configuration files (sitemaps, LLMS text, etc.).