Skip to content
COL0

Docker for beginners: how to package and deploy your app

Docker solves the classic "it works on my machine": it packages your app with everything it needs so it runs the same on any server.

Written by Victor Barrera

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

  1. Write a Dockerfile at the root of the project: official base image, copy the code, install dependencies and the start command.
  2. Add a .dockerignore so you do not copy node_modules, .git or .env files.
  3. Test locally: docker build and docker run.
  4. Describe your stack in compose.yaml with the app, the database and their volumes.
  5. Install Docker on the server and start everything with docker compose up -d.
  6. Put an HTTPS proxy in front (Caddy or Nginx) and set automatic restart (restart: unless-stopped).
  7. Update with docker compose pull and docker 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.

Frequently asked questions

Do I need Docker to deploy my app?

Not always. For a small project, running a service directly on the server can be simpler. Docker is worth it when you have several services, complex dependencies, or several environments that must be identical.

What is the difference between an image and a container?

The image is the packaged recipe of your app. The container is that image running. From one image you can start many containers.

Ready to publish your project?

Book your free 30-minute session and leave with a clear plan.

Book your free session