ENGINEERING NOTE / 02
Docker and deployment
I containerize applications so builds and runtime dependencies are repeatable. My portfolio and several projects use Docker, a reverse proxy, HTTPS, and image-based deployment on a Linux server.
In this note 06 questions
Why use a multi-stage Docker build?
A build stage installs tools and produces the application artifact. A smaller runtime stage serves only what is needed in production. This separates build dependencies from the deployed image.
What does Docker Compose manage?
Compose describes related services, networks, volumes, and restart behavior in one configuration. It is useful for coordinating a web application, database, and reverse proxy during deployment.
Where does Nginx fit?
Nginx can serve static assets or proxy requests to an application. For WebSocket applications, the proxy must preserve connection upgrade headers and route traffic to the correct upstream.
How should HTTPS be handled?
The public reverse proxy terminates TLS and routes requests by domain. DNS must point to the server and the application must generate canonical URLs for its public HTTPS origin.
What is a safe deployment workflow?
Build an image in CI, publish an immutable version tag, deploy that version, check the service, and retain an earlier image for rollback. My resume platform uses GitHub Actions and GHCR in this workflow.
How do you troubleshoot a failed deployment?
Check DNS and TLS first, then proxy routing, container health and logs, network reachability, and application configuration. Separating those layers narrows down the failure.