Do not install infrastructure the container does not use
Self-hosted browser automation often requires a compatible browser binary, operating-system packages, fonts, sandbox configuration, shared memory, and process cleanup. A hosted screenshot API client does not. Its container can remain focused on authorization, request creation, result validation, and storage.
This reduces image complexity, but it does not remove operational responsibility from the application.
Keep secrets out of layers
Build arguments, Dockerfile environment values, copied configuration, and command history can become part of image metadata or caches. Inject the API key only when the container starts and restrict access to the service account that needs it.
Apply outbound network policy so a compromised or misconfigured worker cannot call arbitrary destinations. Validate target URLs before they are sent to Snapshot Site.
Design for ephemeral processes
Do not assume the container filesystem is durable. Stream validated artifacts into application storage and persist job status outside the process. On shutdown, stop claiming work and return unfinished jobs safely.
Health probes should verify process readiness without issuing a screenshot request each time. Track provider operations through application metrics and bounded synthetic checks instead.
The Express integration provides a route pattern, while multiple URL capture covers worker pools and durable progress.