# Use official .NET SDK to build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS builder

WORKDIR /app

# Copy project file and restore dependencies
COPY uncloseai.csproj ./
RUN dotnet restore

# Copy source and build
COPY uncloseai.cs ./
RUN dotnet build -c Release -o /app/build

# Run stage
FROM mcr.microsoft.com/dotnet/runtime:8.0

WORKDIR /app

# Copy built application from builder
COPY --from=builder /app/build .

CMD ["dotnet", "uncloseai.dll"]
