What are Docker Compose profiles good for?

Experience Level: Senior
Tags: Docker Compose

Answer

You can assign Docker Compose services to profiles. Later when you are starting services, you can define which profile to use. If you pass a profile, only services that belong to a specified profile will be used.

version: "3.9"
services:
  frontend:
    image: frontend
    profiles: ["frontend"]
  healthcheck:
    image: busybox
    profiles: ["frontend"]
  phpmyadmin:
    image: phpmyadmin
    depends_on:
      - db
    profiles:
      - debug

Here the services frontend and healthcheck are assigned to the profiles frontend. You can run services from this profile by running the following command:

docker compose --profile frontend up

Comments

No Comments Yet.
Be the first to tell us what you think.
Docker Compose
Docker Compose

Are you learning Docker Compose ? Try our test we designed to help you progress faster.

Test yourself

Chat

Oh, the operator is not available. Leave us your comments. We will answer all your questions as soon as possible.

Comments

Anonymous
Καλησπέρα.
Anonymous
the infinteis -3/15 so 1triition / infinet
Anonymous
e
Anonymous
<a href="https://inspirum.pl "
Anonymous
[url]https://inspirum.pl[/url]
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e