State is the data or condition that persists between operations and influences later behavior. Databases are stateful because their data must survive machine or container destruction; the Python and Node.js applications are stateless because their environments can be recreated. section 5.1.4
Deployment examples show several ways to preserve or provide state:
- Treat database data as persistent state and protect it with backup data. section 5.1.4
- Use container volumes to preserve data even when a container stops or is destroyed. section 6.0
- Use environment variables for API keys, secret credentials, and connections to external database services. section 6.0
- Compare desired, current, and updated state when Ansible applies declared tasks to hosts. section 4.2.2
A container that forgets NGINX
Installing NGINX interactively inside an Ubuntu container works only temporarily. After the container exits, running it again produces “No such file or directory” and “command not found,” demonstrating why container changes must be made through a reproducible image rather than long-term manual modification. section 5.1.4
docker run --rm -it ubuntu /bin/bashcat /etc/nginx/sites-available/defaultnginx -vexit
Inspect the commands used to enter a temporary Ubuntu container, examine NGINX configuration, check its version, and exit. section 5.1.4






































