My containers keep getting OOMKilled—how do I set memory limits correctly for PHP-FPM and Go?
Measure the working set instead of raising the limit; compute max_children against the cap in PHP-FPM and set GOMEMLIMIT plus GOMAXPROCS in Go.
Tag
Containerization with Docker: image layers, multi-stage builds and portable environments. Questions under this tag, answered directly.
7 answered questions carry this tag.
Measure the working set instead of raising the limit; compute max_children against the cap in PHP-FPM and set GOMEMLIMIT plus GOMAXPROCS in Go.
Flip `CMD` to exec form and listen with `signal.NotifyContext(..., syscall.SIGTERM)` instead of `os.Interrupt`; add tini only if the worker forks.
Pin the user with a build-time `ARG UID`, use `COPY --chown`, and for named volumes chown only `storage` and `bootstrap/cache` in the entrypoint.
Define readiness, liveness and startup as Kubernetes probes; keep HEALTHCHECK only if the image also runs under Compose, pointing both at one endpoint.
Move the runner to a register-run-once-destroy model and run jobs unprivileged; never hand over the Docker socket, and never run fork PRs on it.
Leave the build tools in the builder stage: make the final stage distroless/static or scratch for Go and fpm-alpine for PHP, and run as non-root.
This is an addressing-plan problem, not a routing bug: pin Docker's pool in daemon.json, cut AllowedIPs down to the DB subnet, make routes persistent.