ai-code-battle/starters/csharp/Dockerfile
jedarden ca5b20b7b7 feat(starter/csharp): complete C# starter kit with docs, tests, and Docker verification
- README.md with comprehensive setup/compile/test instructions
- Unit tests for Grid helper methods (toroidal distance, neighbors, BFS)
- Dockerfile with multi-stage build (builder, test, runtime stages)
- Verified: docker build --target test passes, HTTP endpoints work
- C# starter already indexed in web/src/pages/docs.ts

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 01:26:32 -04:00

30 lines
662 B
Docker

# Build stage
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS builder
WORKDIR /app
COPY acb-starter-csharp.csproj .
RUN dotnet restore
COPY Program.cs Grid.cs .
RUN dotnet publish -c Release -o /out
# Test stage
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS test
WORKDIR /app/tests/GridTests
COPY tests/GridTests/GridTests.csproj .
RUN dotnet restore
COPY tests/GridTests/GridTests.cs .
COPY tests/GridTests/Grid.cs .
RUN dotnet test
# Runtime stage - use ASP.NET Core runtime for web apps
FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine
WORKDIR /app
COPY --from=builder /out .
ENV BOT_PORT=8080
ENV BOT_SECRET=""
EXPOSE 8080
CMD ["dotnet", "acb-starter-csharp.dll"]