Articles
Practical, deeply explained engineering writing — free to read, no sign-up required.
All Articles
Automating Builds with GitHub Actions
By automating your builds with GitHub Actions, your repository does the heavy lifting for you. Every time you push code to GitHub, a secure, isolated server spins up, packages your application into a Docker container, and publishes it seamlessly to Docker Hub.
Container Security and Image Scanning
Containers package your applications making them easy to deploy, but they also package operating system dependencies and libraries. If those dependencies have known vulnerabilities, you are shipping an insecure application directly into your production environment. Learning basic container security ensures you stop attacks before they ever leave your CI/CD pipeline.
Overriding Compose Files for Dev and Prod
When you build a modern application, the environment you use to write code on your laptop is fundamentally different from the environment that runs in production. Locally, you want hot-reloading, exposed debugging ports, and verbose logs. In production, you want strict security, minimal exposed ports, and automated restart policies.
Managing Startup Order with Depends_On
When building microservices, we often run multiple containers at the same time using Docker Compose. A common scenario is starting a backend API alongside a database like PostgreSQL or Redis. But here is the problem: a lightweight API starts in less than a second, while a database might take five to ten seconds to allocate memory and accept connections. If the API tries to connect before the database is ready, the API crashes.
Environment Variables and Secrets in Compose
When you build modern applications, your code has to run in multiple places: your local laptop, a staging server, and a live production environment. In each of these places, the application needs different configuration details, like database passwords, API keys, and server port numbers.
Building a Full-Stack App with Compose
In modern software development, applications are rarely just one piece of code. A typical project requires a database to store information, a backend API to process business logic, and a frontend user interface for customers to interact with. Starting, configuring, and connecting all these moving parts manually on your computer is slow, frustrating, and prone to errors. Docker Compose solves this exact problem by letting you define your entire full-stack architecture in a single configuration file and launch it with one simple command.
Introduction to Docker Compose and YAML
Stop running long, complicated CLI commands. Docker is incredible for packaging applications, but as soon as your app needs a database, a cache, and a web server to run together, typing out multiple docker run commands with endless flags becomes a massive headache. Learn how to define and manage multi-container applications easily using a single docker-compose.yml file.
Creating Custom Bridge Networks
When you start building real-world applications, a single container is rarely enough. A modern architecture usually involves multiple services—for example, a Node.js API communicating with a MongoDB database. For these microservices to talk to each other securely and reliably, they need to be on the same network.
Bind Mounts for Local Development
When you start learning Docker, you quickly run into a very frustrating problem: every time you fix a typo in your code, you have to stop the container, rebuild the entire Docker image, and start it up again. This turns a simple one-second fix into a slow, multi-minute waiting game.
Persistent Data with Docker Volumes
When a container crashes, restarts, or is destroyed, all the data written inside it dies with it. While this is great for stateless applications like web APIs, it is a disaster if you are running a database like PostgreSQL or MongoDB. To safely persist database records, user uploads, and application state, you must use Docker Volumes.
Exposing Ports and Connecting Containers
However, this isolation creates a common problem for beginners: if you run a web server inside a container, your computer's web browser cannot see it by default. To bridge this gap, you must map the container's internal ports to your computer's external ports.
Introduction to Docker Networking
It cannot talk to other containers, and the outside world cannot talk to it. While isolation is great for security, real-world applications require communication. A web application must talk to a database, and users on the internet must be able to reach the web application.