docker-containers
БесплатноБез исполняемых скриптовНе проверенMulti-container .NET applications with Docker Compose, container orchestration, and development environments
от TheLobbi★ 22 звезды на GitHubОб этом скилле
Multi-Container .NET Applications
Multi-Stage Dockerfile (.NET 10)
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
# Copy solution and project files for layer caching
COPY *.sln .
COPY Directory.Build.props Directory.Packages.props ./
COPY src/MyApp.Web/MyApp.Web.csproj src/MyApp.Web/
COPY src/MyApp.Api/MyApp.Api.csproj src/MyApp.Api/
COPY src/MyApp.Domain/MyApp.Domain.csproj src/MyApp.Domain/
COPY src/MyApp.Infrastructure/MyApp.Infrastructure.csproj src/MyApp.Infrastructure/
RUN dotnet restore
# Copy source and publish
COPY . .
RUN dotnet publish src/MyApp.Web/MyApp.Web.csproj -c Release -o /app/publish --no-restore
# Runtime stage (minimal image)
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
WORKDIR /app
EXPOSE 8080
ENV ASPNETCORE_URLS=http://+:8080
ENV DOTNET_RUNNING_IN_CONTAINER=true
# Non-root user for security
USER $APP_UID
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "MyApp.Web.dll"]
Docker Compose (Development)
services:
# Blazor Web App
webapp:
build:
context: .
dockerfile: src/MyApp.Web/Dockerfile
ports:
- "5000:8080"
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__Default=Host=postgres;Database=myapp;Username=postgres;Password=devpass
- ConnectionStrings__Redis=redis:6379
- RabbitMQ__Host=rabbitmq
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
volumes:
- ~/.aspnet/https:/https:ro # Dev HTTPS certs
networks:
- backend
# API Service
api:
build:
context: .
dockerfile: src/MyApp.Api/Dockerfile
ports:
- "5001:8080"
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__Default=Host=postgres;Database=myapp;Username=postgres;Password=devpass
- ConnectionStrings__Redis=redis:6379
depends_on:
postgres:
condition: service_healthy
networks:
- backend
# Worker Service
worker:
build:
context: .
dockerfile: src/MyApp.Worker/Dockerfile
environment:
- ConnectionStrings__Default=Host=postgres;Database=myapp;Username=postgres;Password=devpass
- RabbitMQ__Host=rabbitmq
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
networks:
- backend
# PostgreSQL
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: myapp
POSTGRES_USER: postgres
POSTGRES_PASSWORD: devpass
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
networks:
- backend
# Redis
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- backend
# RabbitMQ
rabbitmq:
image: rabbitmq:3-management-alpine
ports:
- "5672:5672" # AMQP
- "15672:15672" # Management UI
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "check_port_connectivity"]
interval: 10s
timeout: 5s
retries: 5
networks:
- backend
# SQL Server (alternative to PostgreSQL)
# sqlserver:
# image: mcr.microsoft.com/mssql/server:2022-latest
# environment:
# ACCEPT_EULA: "Y"
# MSSQL_SA_PASSWORD: "YourStrong!Password"
# ports:
# - "1433:1433"
volumes:
postgres_data:
redis_data:
networks:
backend:
driver: bridge
Integration Event Bus (RabbitMQ)
// Integration event (crosses service boundaries)
public sealed record OrderPaymentSucceededIntegrationEvent(
int OrderId, DateTime PaymentDate) : IntegrationEvent;
// Event bus interface
public interface IEventBus
{
Task PublishAsync<T>(T @event, CancellationToken ct = default) where T : IntegrationEvent;
void Subscribe<T, THandler>() where T : IntegrationEvent where THandler : IIntegrationEventHandler<T>;
}
// Integration event handler
public sealed class OrderPaymentSucceededHandler(
IOrderRepository orderRepo,
ILogger<OrderPaymentSucceededHandler> logger)
: IIntegrationEventHandler<OrderPaymentSucceededIntegrationEvent>
{
public async Task Handle(OrderPaymentSucceededIntegrationEvent @event, CancellationToken ct)
{
logger.LogInformation("Payment succeeded for order {OrderId}", @event.OrderId);
var order = await orderRepo.GetAsync(@event.OrderId, ct);
order?.SetPaidStatus();
await orderRepo.UnitOfWork.SaveEntitiesAsync(ct);
}
}
API Gateway Pattern
// Using YARP (Yet Another Reverse Proxy) - Microsoft's recommended gateway
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddReverseProxy()
.LoadFromConfig
Установить docker-containers в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashGrepFAQ
Что делает скилл docker-containers?
Multi-container .NET applications with Docker Compose, container orchestration, and development environments
Как установить скилл docker-containers?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл docker-containers запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
The scan that the plugin's GitHub Action runs.
от Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
от GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
от GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
от GitHub