Spaces:
Running
Running
| # Stage 1: Build .NET 10 API | |
| FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build | |
| WORKDIR /src | |
| # Copy csproj files and restore dependencies | |
| COPY ["FlowAPI/FlowAPI.csproj", "FlowAPI/"] | |
| COPY ["FlowAPI.Application/FlowAPI.Application.csproj", "FlowAPI.Application/"] | |
| COPY ["FlowAPI.Domain/FlowAPI.Domain.csproj", "FlowAPI.Domain/"] | |
| COPY ["FlowAPI.Infrastructure/FlowAPI.Infrastructure.csproj", "FlowAPI.Infrastructure/"] | |
| RUN dotnet restore "FlowAPI/FlowAPI.csproj" | |
| # Copy everything else and build | |
| COPY . . | |
| WORKDIR "/src/FlowAPI" | |
| RUN dotnet publish "FlowAPI.csproj" -c Release -o /app/publish /p:UseAppHost=false | |
| # Stage 2: Runtime | |
| FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final | |
| WORKDIR /app | |
| ENV ASPNETCORE_URLS=http://+:7860 | |
| ENV ASPNETCORE_ENVIRONMENT=Production | |
| EXPOSE 7860 | |
| # Create persistent data directory for SQLite | |
| RUN mkdir -p /data/data | |
| # Install Node.js 20 | |
| RUN apt-get update && apt-get install -y curl && \ | |
| curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ | |
| apt-get install -y nodejs && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Copy published .NET app | |
| COPY --from=build /app/publish . | |
| # Copy FreeDeepseekAPI proxy | |
| COPY FlowAPI/FreeDeepseekAPI ./FreeDeepseekAPI | |
| # Set entrypoint | |
| ENTRYPOINT ["dotnet", "FlowAPI.dll"] | |