sehaj/learn

Course 01 · Docker · v1

Docker, from first principles.

Start with what a container really is. Finish by shipping a four-service app to a real server. Every lesson has commands to run, a quiz to check yourself, and the interview questions it prepares you for.

Before you start

You should know

Basic terminal use: cd, ls, running a command. Some idea of what a web server is.

You'll need

A laptop that can run Docker Desktop or Docker Engine, and about 10 GB of free disk.

You'll leave with

A production-ready image, a Compose stack, a CI pipeline and a deployed app on your GitHub.

Curriculum
The project

One app, built a step at a time as you learn. A Node API with Postgres, Redis and Nginx. Every step is a git tag in the companion repo, so you can check out any point and compare.

  1. Containerise the API

    git checkout docker-step-01

    A multi-stage Dockerfile for the notes API, built and pushed to a registry. · after module 02

  2. Configure and health-check it

    git checkout docker-step-02

    Env-based config, a healthcheck and sensible limits. · after module 03

  3. Persist Postgres

    git checkout docker-step-03

    Notes move to Postgres 18 on a named volume, with a tested dump and restore. · after module 04

  4. Wire the services together

    git checkout docker-step-04

    Nginx in front, a Redis cache, and separate public and private networks. · after module 05

  5. One-command dev environment

    git checkout docker-step-05

    docker compose up --watch: healthy startup order, seeded data and hot reload. · after module 06

  6. Ship from CI

    git checkout docker-step-06

    GitHub Actions builds, scans with Trivy and publishes amd64 + arm64 images to GHCR. · after module 07

  7. Deploy to a VPS

    git checkout docker-step-07

    A hardened production compose file, secrets from files, deploys and rollbacks by tag. · after module 07

Interview bank
Junior11/11 guidesMust-knowConcept

What's the difference between an image and a container?

Junior11/11 guidesMust-knowConcept

What is a Dockerfile, and which instructions do you use most?

Junior11/11 guidesMust-knowConcept

Will you lose data when a container exits? How do you persist data?

Junior11/11 guidesMust-knowConcept

What is Docker Compose, and how is it different from a Dockerfile?

Junior10/11 guidesMust-knowConcept

What's the difference between a container and a virtual machine?

The most-asked questions across 11 widely read Docker interview guides, with model answers.

Open all 54 questions →