mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 11:44:56 +00:00
update docker file
This commit is contained in:
+17
-6
@@ -1,23 +1,34 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# Êîïèðóåì òîëüêî .sln è .csproj
|
||||
COPY *.sln ./
|
||||
COPY Govor.API/*.csproj Govor.API/
|
||||
COPY Govor.Application/*.csproj Govor.Application/
|
||||
COPY Govor.Core/*.csproj Govor.Core/
|
||||
COPY Govor.Data/*.csproj Govor.Data/
|
||||
COPY Govor.Contracts/*.csproj Govor.Contracts/
|
||||
COPY Govor.API/*.csproj ./Govor.API/
|
||||
COPY Govor.Application/*.csproj ./Govor.Application/
|
||||
COPY Govor.Core/*.csproj ./Govor.Core/
|
||||
COPY Govor.Data/*.csproj ./Govor.Data/
|
||||
COPY Govor.Contracts/*.csproj ./Govor.Contracts/
|
||||
|
||||
RUN dotnet restore Govor.API/Govor.API.csproj
|
||||
|
||||
# Êîïèðóåì âåñü êîä
|
||||
COPY . .
|
||||
|
||||
# ÓÄÀËßÅÌ launchSettings.json
|
||||
RUN rm -f Govor.API/Properties/launchSettings.json
|
||||
|
||||
WORKDIR /src/Govor.API
|
||||
RUN dotnet publish -c Release -o /app/publish
|
||||
|
||||
# Runtime image
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/publish .
|
||||
|
||||
# Ïðèíóäèòåëüíî óñòàíàâëèâàåì ïîðò
|
||||
ENV ASPNETCORE_URLS=http://+:8080
|
||||
ENV ASPNETCORE_ENVIRONMENT=Production
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT ["dotnet", "Govor.API.dll"]
|
||||
ENTRYPOINT ["dotnet", "Govor.API.dll"]
|
||||
Reference in New Issue
Block a user