33 lines
958 B
Docker
33 lines
958 B
Docker
# Build stage
|
|
FROM mcr.microsoft.com/dotnet/sdk:10.0-preview AS build
|
|
WORKDIR /src
|
|
|
|
# Copy solution and project files
|
|
COPY ["Nashel.sln", "./"]
|
|
COPY ["src/", "src/"]
|
|
COPY ["tests/", "tests/"]
|
|
|
|
# Restore dependencies
|
|
RUN dotnet restore "Nashel.sln"
|
|
|
|
# Publish the application
|
|
WORKDIR "/src/src/Host"
|
|
RUN dotnet publish "Nashel.Host.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
|
|
|
# Final stage
|
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0-preview AS final
|
|
WORKDIR /app
|
|
|
|
# Устанавливаем зависимости Npgsql / Kerberos (нужны для PostgreSQL через Npgsql в .NET 10 preview)
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
libgssapi-krb5-2 \
|
|
krb5-user \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=build /app/publish .
|
|
# Copy wwwroot folder for static files (uploads)
|
|
COPY src/Host/wwwroot /app/wwwroot
|
|
ENV ASPNETCORE_URLS=http://+:8080
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["dotnet", "Nashel.Host.dll"]
|