Dockerfile - Best Practices
summary
Shows how to refactor a single monolithic Dockerfile into four focused images—client (Node), server (OpenJDK), MongoDB, and nginx—wired together with Docker Compose. Uses Dockerfile best practices and multi-stage builds: replace manual installs with official images (mongo, nginx, node, openjdk), remove dev dependencies and apt caches, add a non-root user, and copy package.json first to preserve layer caching. Outcomes are faster, smaller, and more reproducible builds, with Docker Compose networks isolating services to improve security.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 3:13One service per container
- 7:10Official images and multi-stage
- 12:26Dev optimization
- 19:23Security and dedicated users
- 20:46Orchestration with Docker Compose
- 26:06Summary and best practices
related talks
29mDockerfile: the best practices
41mDocker Best-Practice and Dockerfile Optimization
36mDockerization in the land of Ruby
44mDocker and the Path to a Better Staging Environment
30mSimplify All the Things with Docker Compose
34mDefence Against the Docker Arts
28mHow to Get Started with Docker
56mDocker Container Loading
