How would you containerize a legacy app that writes to local disk and holds sessions in memory?
AdvancedProductionArchitecture & Design Decisions
Answer
First step: lift and shift into one container with a volume for its data and a single replica, to get repeatable deployments. Then externalize state: sessions to Redis, uploads to S3, DB to a managed service, logs to stdout. Only after that can you scale horizontally and use rolling deploys. Resist forcing it onto Kubernetes before it is stateless.
More on Architecture & Design Decisions
How would you design a container build-and-deploy pipeline from commit to production?AdvancedWhen should you use Docker Compose, Swarm, ECS, or Kubernetes?IntermediateHow do you decide how many processes belong in one container?BeginnerHow do you design the config strategy for containerized apps (12-factor)?IntermediateAlpine or Debian-slim for a Python service?IntermediateHow do you structure a reverse proxy in front of containers?Intermediate