Docker Compose Tip #13: Using external networks to connect multiple projects

Need your frontend project to talk to a backend in another Compose project? External networks let you connect containers across different stacks. The problem Two separate Compose projects need to communicate: frontend/compose.yml - React app backend/compose.yml - API service By default, each creates its own isolated network. The solution Create a shared external network: # Create the network once docker network create shared-network Then reference it in both projects: backend/compose.yml: ...

January 21, 2026 · 2 min · 308 words · Guillaume Lours

Docker Compose Tip #12: Using target to specify build stages

One Dockerfile, multiple environments. Use target to build only the stage you need - faster builds, smaller images, cleaner separation. The basics Multi-stage Dockerfile: # Development stage FROM node:20-alpine AS development WORKDIR /app COPY package*.json ./ RUN npm install COPY . . CMD ["npm", "run", "dev"] # Production stage FROM node:20-alpine AS production WORKDIR /app COPY package*.json ./ RUN npm ci --only=production COPY . . RUN npm run build CMD ["npm", "start"] Target specific stages in compose.yml: ...

January 20, 2026 · 2 min · 313 words · Guillaume Lours

Docker Compose Tip #11: Mastering docker compose up --watch for hot reload

Stop manually restarting containers when code changes. Docker Compose Watch automatically syncs files and reloads services - zero interruption development. The basics Enable watch mode with: docker compose up --watch # If you don't want mixed logs, you can run it in a dedicated process, you need to have your stack started on its own process docker compose watch Then configure watching in your compose.yml: services: web: image: node:20 command: npm start develop: watch: - path: ./src target: /app/src action: sync - path: package.json action: rebuild Files in ./src sync instantly. Changes to package.json trigger a rebuild. ...

January 19, 2026 · 2 min · 365 words · Guillaume Lours

Docker Compose Tip #10: Using init for proper PID 1 handling

Zombie processes in your containers? Slow shutdowns? Your app shouldn’t run as PID 1. Here’s the simple fix. The problem When your app runs as PID 1, it has special responsibilities: Handle system signals (SIGTERM, SIGINT) Reap zombie processes Forward signals to child processes Most apps (especially Node.js, Python) don’t handle these well. The solution Add init: true to your service: services: app: image: node:20 init: true # Adds Tini as PID 1 command: node server.js Docker automatically injects a tiny init system (Tini) that handles PID 1 responsibilities properly. ...

January 16, 2026 · 3 min · 432 words · Guillaume Lours

Docker Compose Tip #9: Publishing Compose applications as OCI artifacts

Package your entire Docker Compose application as an OCI artifact and share it through any container registry. No more complex installation instructions. The basics Publish your Compose configuration as an OCI artifact: # Publish your compose.yml to a registry docker compose publish myusername/myapp:v1.0 # Users run it directly with oci:// prefix docker compose -f oci://docker.io/myusername/myapp:v1.0 up The compose.yml (and any included files) are stored as an OCI artifact alongside your container images. ...

January 15, 2026 · 2 min · 414 words · Guillaume Lours