Create Docker configuration for ASP.NET Core applications
I create Docker configuration for .NET apps:
Use this skill when:
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["src/ProjectName.Api/ProjectName.Api.csproj", "ProjectName.Api/"]
COPY ["src/ProjectName.Application/ProjectName.Application.csproj", "ProjectName.Application/"]
COPY ["src/ProjectName.Domain/ProjectName.Domain.csproj", "ProjectName.Domain/"]
COPY ["src/ProjectName.Infrastructure/ProjectName.Infrastructure.csproj", "ProjectName.Infrastructure/"]
RUN dotnet restore "ProjectName.Api/ProjectName.Api.csproj"
COPY . .
WORKDIR "/src/ProjectName.Api"
RUN dotnet build "ProjectName.Api.csproj" -c Release -o /app/build
# Publish stage
FROM build AS publish
RUN dotnet publish "ProjectName.Api.csproj" -c Release -o /app/publish /p:UseAppHost=false
# Runtime stage
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
WORKDIR /app
EXPOSE 80
EXPOSE 443
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "ProjectName.Api.dll"]
HEALTHCHECK --interval=30s --timeout=3s \
CMD curl -f http://localhost/health || exit 1
version: '3.8'
services:
api:
build:
context: .
dockerfile: Dockerfile
ports:
- "5000:80"
- "5001:443"
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__DefaultConnection=Host=db;Database=appdb;Username=app;Password=app
- JwtSettings__Secret=your-secret-key
depends_on:
db:
condition: service_healthy
volumes:
- ./src/ProjectName.Api/appsettings.Development.json:/app/appsettings.Development.json
networks:
- app-network
db:
image: postgres:15-alpine
environment:
- POSTGRES_DB=appdb
- POSTGRES_USER=app
- POSTGRES_PASSWORD=app
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U app"]
interval: 10s
timeout: 5s
retries: 5
networks:
- app-network
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis-data:/data
networks:
- app-network
volumes:
postgres-data:
redis-data:
networks:
app-network:
driver: bridge
**/bin/
**/obj/
**/out/
**/.vs/
**/TestResults/
**/*.user
**/*.suo
**/*.cache
**/*.log
**/.vscode/
**/*.md
.git/
.gitignore
docker-compose*.yml
Dockerfile*
latest)Create Docker configuration with:
- Multi-stage Dockerfile
- docker-compose for local dev
- PostgreSQL database
- Redis cache
- Health checks
- Volume mounts
I will generate complete Docker configuration.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer