Run one process per container, keep images small, never run as root, and treat containers as ephemeral.
Containers that behave
One process per container
A container with a process supervisor (systemd, supervisord) is fighting the model. Split into two containers.
Keep images small
alpineordistrolessinstead ofubuntu:latest. Smaller image = faster pull, fewer CVEs.Never run as root
USER appuserin the Dockerfile. A root container shares the host's root kernel capabilities.Treat containers as ephemeral
Data goes in volumes, logs go to stdout, state goes to a database. The container is disposable.
Pin image digests
image@sha256:...in production. Tags move; digests do not.