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:
+16
-5
@@ -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"]
|
||||
@@ -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 |
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 138 KiB |
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 314 KiB |
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 138 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 480 KiB |
Reference in New Issue
Block a user