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.
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.