Week 2: A server app in a container

Week 2: A server app in a container

The static page gets a backend. You write a small Express server, package it as a container image, and let the pipeline build the image, store it in GitLab's registry and run it on your server. From here on, deploying means shipping a container.

Pushing a tag builds an image and replaces the running container on your server.

Issues

Work through the issues in order, in your own repository. Each one builds on the one before.

IssueWhat you do
express-serverAn Express server with two JSON routes and an automated test.
dockerizeA Dockerfile so the app runs the same on your computer and on the server.
provision-dockerAnsible installs Docker on the server, as it installed Caddy.
deploy-containerCI builds and pushes the image, and the server pulls and runs it behind Caddy.

Write the week report in report/week-2.md after the last issue.

Slide decks

Each deck is a self-study lecture of about 15–20 minutes, except the intro, which takes about five.

Reading material