How to Use Docker Compose Profiles

I am a french Developer, working for a french startup :) i like video games, computers and drinking Ricoré
Search for a command to run...

I am a french Developer, working for a french startup :) i like video games, computers and drinking Ricoré
AWS Bedrock AgentCore lets you deploy agents as managed containerized runtimes. This guide shows how to automate this deployment using Pulumi and Docker. What You'll Deploy Docker container with your agent code Amazon ECR to store the image Bedroc...

Introduction This guide shows how to deploy AWS Bedrock Agents using Pulumi and TypeScript. Prerequisites AWS Account with Bedrock access Node.js and npm installed Pulumi CLI installed Project Setup Generate Project with Pulumi pulumi new aws-t...

Starting My Homelab Journey with a Raspberry Pi 4B

These days, i’m using AWS Bedrock to create Agents.And i faced this error when testing my agents many times so i decided to write down the workaround that i found. An error occurred (dependencyFailedException) when calling the InvokeAgent operation: ...

I recently discovered Docker compose profiles and wanted to share it as it can be useful to someone else.
Docker Compose profiles let you control which services run without modifying your docker-compose.yml. They’re useful for separating optional services (like monitoring tools or debugging containers) from your core stack.
From Docker documentation:
Profiles help you adjust your Compose application for different environments or use cases by selectively activating services. Services can be assigned to one or more profiles; unassigned services start/stop by default, while assigned ones only start/stop when their profile is active. This setup means specific services, like those for debugging or development, can be included in a single compose.yml file and activated only as needed.
1. Add Profiles to Your Compose File
In your docker-compose.yml, specify the profiles key for optional services:
services:
app:
container_name: my-app
image: myapp:latest
ports:
- "8080:8080"
db:
container_name: pg-database
image: postgres:15
adminer:
container_name: adminer
image: adminer
ports:
- "8081:8080"
profiles:
- debug
Here, adminer is tagged with the debug profile, while app and db always run.
Run only the default services:
docker compose up
Run services including the debug profile:
docker compose --profile debug up
That’s it !
You can now use profiles to load your local dev tools only when you need them.