The concepts you need
- Dockerfile: the file with the instructions to build your image.
- Image: your app packaged with its base system and dependencies.
- Container: a running copy of that image.
- Volume: a folder that survives when the container is replaced (for databases and uploaded files).
- Docker Compose: a file that describes several containers (app, database, cache) and starts them together.
The steps, in short
- Write a Dockerfile at the root of the project: official base image, copy the code, install dependencies and the start command.
- Add a
.dockerignoreso you do not copynode_modules,.gitor.envfiles. - Test locally:
docker buildanddocker run. - Describe your stack in
compose.yamlwith the app, the database and their volumes. - Install Docker on the server and start everything with
docker compose up -d. - Put an HTTPS proxy in front (Caddy or Nginx) and set automatic restart (
restart: unless-stopped). - Update with
docker compose pullanddocker compose up -d.
Common mistakes
- Storing important data inside the container without a volume: it is lost on update.
- Baking passwords into the image; use environment variables or secrets.
- Running the process as root inside the container.
- Publishing the database port to the whole internet.
How we help
We help you decide whether Docker suits you and, if so, leave your project packaged and deployed with a simple update workflow.