update docker file

This commit is contained in:
Artemy
2025-11-04 12:49:41 +07:00
parent e6f7292bab
commit b1e8cc83b2
10 changed files with 24 additions and 13 deletions
+16 -5
View File
@@ -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"]
+2 -2
View File
@@ -109,10 +109,10 @@ builder.Services.AddSwaggerGen(options =>
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
if (!app.Environment.IsDevelopment())
{
//app.MapOpenApi();
builder.WebHost.UseUrls("http://0.0.0.0:8080");
}
app.UseSwagger();
Binary file not shown.

Before

Width:  |  Height:  |  Size: 691 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 480 KiB