B. Blue Green a software delivery tutorial
Vol. I § Zero-downtime series § A series for junior developers
Zero-downtime delivery · 3 / 10 ·

Dockerfile.base and Dockerfile.app

Two Docker files split what rarely changes from what changes often. Dockerfile.base installs the runtime. Dockerfile.app copies titikterang code on top of that image.

Dockerfile.app · titikterang:v1.2.4-devDockerfile.base · runtime & tools
Dockerfile.base underneath, Dockerfile.app on top.

Build order

Build the base first, tag it, then build the app from that base. The lab CI does both before it pushes to the registry.

Sketch:

# Dockerfile.app
FROM registry.titikterang.local:5000/titikterang-base:1
COPY . /app
CMD ["node", "server.js"]

The base layers are reused. Only the app layer changes when you release v1.2.4-dev.

Reader notes

Chapter discussion appears once Giscus is connected to the site repository.