Docker Compose Configuration Standard

Standardize Docker Compose configurations for .NET applications using .env files and double-underscore binding.

Updated Jun 20, 2025
One-click install
npx skills add https://github.com/emaginebr/BazzucaMedia --skill docker-compose-configuration-standard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Docker Compose Configuration Standard
Source: https://github.com/emaginebr/BazzucaMedia/tree/main/.claude/skills/docker-compose-config
Command: npx skills add https://github.com/emaginebr/BazzucaMedia --skill docker-compose-configuration-standard

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures secure and standardized Docker Compose configurations for .NET projects, preventing common pitfalls with environment variables and secrets.

Core Features & Use Cases

  • Secrets Management: Enforces the use of .env files for all sensitive information, keeping them out of version control.
  • Configuration Binding: Guides the correct mapping of environment variables to ASP.NET Core's configuration system using the __ convention.
  • Use Case: You're setting up a new .NET microservice and need to configure its database connection string and API keys securely within Docker Compose. This Skill will help you create the .env.example, .gitignore, and docker-compose.yml files correctly.

Quick Start

Use the docker-compose-config skill to standardize the docker-compose.yml for a .NET project that uses PostgreSQL and a custom API.

Frequently Asked Questions about Docker Compose Configuration Standard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage secrets securely in Docker Compose for a .NET application?

Manage secrets securely in Docker Compose by using a `.env` file to store sensitive information like database connection strings and API keys. The `.env` file must be added to `.gitignore` to prevent accidental exposure in version control.

What is the double-underscore convention for ASP.NET Core configuration binding in Docker Compose?

The double-underscore convention maps environment variables to hierarchical ASP.NET Core configuration keys. Using `__` in your environment variable names correctly binds them to the .NET configuration system without requiring custom code prefixes.

How do I set up a docker-compose.yml file for a .NET microservice?

Set up a `docker-compose.yml` file for a .NET microservice by defining your services and referencing variables from a `.env` file. You also need to create a `.env.example` file to document required variables and update `.gitignore` to exclude the actual `.env` file.

Should I use a custom environment variable prefix for ASP.NET Core configuration in Docker Compose?

You should not use custom environment variable prefixes for ASP.NET Core configuration in Docker Compose. Relying on the standard double-underscore convention ensures correct configuration binding and prevents common mapping pitfalls.

Does Docker Compose work with PostgreSQL and .NET configuration binding?

Docker Compose works with PostgreSQL and .NET configuration binding by defining the PostgreSQL service in the `docker-compose.yml` file. You store the connection string in a `.env` file and map it to the .NET application using the double-underscore convention.

Why are my ASP.NET Core environment variables not binding correctly in Docker Compose?

ASP.NET Core environment variables fail to bind correctly in Docker Compose when you do not use the double-underscore convention for hierarchical keys. Using custom prefixes in your code or failing to load the `.env` file also causes configuration mapping failures.