Docker Compose profiles for optional services
Source: interviewadvanced
WHAT IT TESTS: gating optional services in one Compose file. OUTLINE: profiles tag services so they stay off by default, activate via --profile or COMPOSE_PROFILES, and unprofiled services always run.
WHAT IT TESTS: whether you can keep optional services in a single Compose file without them starting accidentally. ANSWER OUTLINE: assign a service one or more profile names; services with profiles are skipped on plain docker compose up while unprofiled services always start. Activate selected profiles with --profile or the COMPOSE_PROFILES variable. Naming a profiled service directly also starts it and its dependencies.
Read the original → interview
- #docker
- #docker-compose
- #profiles
- #developer-tooling
- #devops
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.