d788dfea03
- Scaffold Budget.Api (ASP.NET Core Web API, net10.0) with EF Core + Npgsql - Scaffold Budget.Client (Vite + React + TypeScript) with /api proxy to localhost:5000 - Define all entity models: Budget, Income, Outgo, KnownUser, BudgetShare - Configure AppDbContext with EF mappings and cascade deletes - Add InitialCreate migration - Configure SPA static file serving + fallback in Program.cs - Add Dockerfile (multi-stage: node + dotnet sdk + aspnet runtime) - Add .env.example with all required environment variables Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
23 lines
641 B
Docker
23 lines
641 B
Docker
# Stage 1: Build React client
|
|
FROM node:22-alpine AS client-build
|
|
WORKDIR /app/client
|
|
COPY src/Budget.Client/package*.json ./
|
|
RUN npm ci
|
|
COPY src/Budget.Client/ ./
|
|
RUN npm run build
|
|
|
|
# Stage 2: Build and publish ASP.NET app
|
|
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS api-build
|
|
WORKDIR /app
|
|
COPY Budget.sln ./
|
|
COPY src/Budget.Api/ ./src/Budget.Api/
|
|
RUN dotnet publish src/Budget.Api/Budget.Api.csproj -c Release -o /publish
|
|
|
|
# Stage 3: Runtime image
|
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0
|
|
WORKDIR /app
|
|
COPY --from=api-build /publish ./
|
|
COPY --from=client-build /app/client/dist ./wwwroot
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["dotnet", "Budget.Api.dll"]
|