Docker
Containers on a VPS of my own: the image, data in a volume and Coolify deployments.
Cloud & DevOpsUsing since 2016 · Featured project: Budzowska Fiutowski i Partnerzy
- Category
- Cloud & DevOps
- Using since
- 2016
- Featured project
- Budzowska Fiutowski i Partnerzy
In practice
I pick Docker so an app behaves the same on my machine, in CI and on the server. At Budzowska Fiutowski i Partnerzy I deployed the site in containers on a self-managed VPS through Coolify, with health checks and CI/CD, instead of paying for subscription hosting.
What is Docker?
Docker runs an app in a container, an isolated process with its own environment. A container does not rely on what is installed on the server, so the same container runs on a laptop, in a data center and in the cloud.
A container is built from an image: an immutable package of code, libraries and configuration, assembled from layers. Data that has to survive a restart goes into a volume managed by Docker, and Docker Compose describes several services together in one compose.yaml file.
How I work with Docker
To me a container is the unit of deployment: an image that passed the tests reaches the server without a rebuild. I begin by asking what belongs in the image and what has to stay outside it.
The app image
I describe the image in a Dockerfile and make sure it builds the same way locally and in CI. An image is immutable, so a fix means a new image, never a hand edit on the server.
Data outside the container
Anything that must outlive a restart I put in a volume or a separate database. That way a container can be thrown away and recreated without losing its contents.
Server and deployments
At Budzowska Fiutowski i Partnerzy the containers run on a self-managed VPS and Coolify handles the deployments, with health checks and CI/CD. On another project I first check whether a cloud such as AWS would suit it better.
When it fits, and when it doesn't
Docker makes sense where the environment has to be repeatable, not where it is merely fashionable.
A good fit when
- An app with a database and a few services that must start the same way locally and on a server.
- A VPS of your own instead of a managed platform.
- CI/CD deployments where one image passes the tests and then goes to production.
- A new teammate who should run the project without hours of setup.
Not a fit when
- A brochure site that runs on plain hosting with no extra services.
- An app on a managed platform that builds the project from the repository itself.
- A project where nobody will update the images and the operating system on the server.
When nobody wants to run a server, I choose a managed platform or a cloud, and then I describe the infrastructure in Terraform.
Frequently asked questions
Have an app to deploy on your own server?
Tell me what has to run and where it lives today. I will say plainly whether containers and a VPS of your own fit, or whether a provider should run the server.