Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • C#
  • Asp.Net Core
  • SQL
  • Windows
  • WordPress
  • AI
  • JavaScript
  • CSS
  • MORE
    • HTML
    • Ajax
    • Git
    • Docker
    • Kubernetes
    • Photoshop
    • Visual Studio

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • C#
  • Asp.Net Core
  • SQL
  • Windows
  • WordPress
  • AI
  • JavaScript
  • CSS
  • MORE
    • HTML
    • Ajax
    • Git
    • Docker
    • Kubernetes
    • Photoshop
    • Visual Studio
Docker

Docker: Use Compose Profiles to Start Only Needed Services

- 17.02.26 - ErcanOPAK

Running all services (database, cache, queue, monitoring) every time is slow. Profiles start only what you need.

docker-compose.yml:

services:
  app:
    build: .
    ports:
      - "3000:3000"

  db:
    image: postgres
    profiles: ["dev", "test"]

  redis:
    image: redis
    profiles: ["dev"]

  monitoring:
    image: grafana
    profiles: ["monitoring"]

  mailhog:
    image: mailhog/mailhog
    profiles: ["dev"]

Start Different Profiles:

# Just the app (no extras)
docker compose up

# Development (app + db + redis + mailhog)
docker compose --profile dev up

# Testing (app + db only)
docker compose --profile test up

# With monitoring
docker compose --profile dev --profile monitoring up

Clean, flexible environment management!

Related posts:

Docker: Master Container Lifecycle Management

Docker: Master Container Lifecycle Management

Docker: Swarm vs Kubernetes — Choose Your Orchestrator

Docker: Swarm vs Kubernetes — Choose Your Orchestrator

Docker: Implementing the HEALTHCHECK Instruction for Self-Healing Containers

Docker: Implementing the HEALTHCHECK Instruction for Self-Healing Containers

Views: 19
Found this useful? Share it
XLinkedInWhatsApp

Post navigation

Kubernetes: Use Pod Disruption Budget to Ensure Availability During Maintenance
AI Prompt: Create Personalized Workout Plan Based on Equipment and Goals

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Most Read

  1. 01How to make theater mode the default for Youtube 1,080 views
  2. 02How to add default value for Entity Framework migrations for DateTime and Bool 997 views
  3. 03Get the User Name and Domain Name from an Email Address in SQL 996 views
  4. 04Get the First and Last Word from a String or Sentence in SQL 873 views
  5. 05How to select distinct rows in a datatable in C# 869 views
  6. 06How to enable, disable and check if Service Broker is enabled on a database in SQL Server 672 views
  7. 07Add Constraint to SQL Table to ensure email contains @ 631 views
  8. 08Average of all values in a column that are not zero in SQL 585 views
  9. 09How to use Map Mode for Vertical Scroll Mode in Visual Studio 562 views
Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
Back to top
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com