mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +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
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
|
# Êîïèðóåì òîëüêî .sln è .csproj
|
||||||
COPY *.sln ./
|
COPY *.sln ./
|
||||||
COPY Govor.API/*.csproj Govor.API/
|
COPY Govor.API/*.csproj ./Govor.API/
|
||||||
COPY Govor.Application/*.csproj Govor.Application/
|
COPY Govor.Application/*.csproj ./Govor.Application/
|
||||||
COPY Govor.Core/*.csproj Govor.Core/
|
COPY Govor.Core/*.csproj ./Govor.Core/
|
||||||
COPY Govor.Data/*.csproj Govor.Data/
|
COPY Govor.Data/*.csproj ./Govor.Data/
|
||||||
COPY Govor.Contracts/*.csproj Govor.Contracts/
|
COPY Govor.Contracts/*.csproj ./Govor.Contracts/
|
||||||
|
|
||||||
RUN dotnet restore Govor.API/Govor.API.csproj
|
RUN dotnet restore Govor.API/Govor.API.csproj
|
||||||
|
|
||||||
|
# Êîïèðóåì âåñü êîä
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# ÓÄÀËßÅÌ launchSettings.json
|
||||||
|
RUN rm -f Govor.API/Properties/launchSettings.json
|
||||||
|
|
||||||
WORKDIR /src/Govor.API
|
WORKDIR /src/Govor.API
|
||||||
RUN dotnet publish -c Release -o /app/publish
|
RUN dotnet publish -c Release -o /app/publish
|
||||||
|
|
||||||
|
# Runtime image
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=build /app/publish .
|
COPY --from=build /app/publish .
|
||||||
|
|
||||||
|
# Ïðèíóäèòåëüíî óñòàíàâëèâàåì ïîðò
|
||||||
ENV ASPNETCORE_URLS=http://+:8080
|
ENV ASPNETCORE_URLS=http://+:8080
|
||||||
|
ENV ASPNETCORE_ENVIRONMENT=Production
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
ENTRYPOINT ["dotnet", "Govor.API.dll"]
|
ENTRYPOINT ["dotnet", "Govor.API.dll"]
|
||||||
@@ -24,10 +24,10 @@ builder.Services.AddCors(options =>
|
|||||||
"http://localhost:7155",
|
"http://localhost:7155",
|
||||||
"https://govor-team-govor-8ce1.twc1.net",
|
"https://govor-team-govor-8ce1.twc1.net",
|
||||||
"http://govor-team-govor-8ce1.twc1.net"
|
"http://govor-team-govor-8ce1.twc1.net"
|
||||||
)
|
)
|
||||||
.AllowAnyHeader()
|
.AllowAnyHeader()
|
||||||
.AllowAnyMethod()
|
.AllowAnyMethod()
|
||||||
.AllowCredentials();
|
.AllowCredentials();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -109,10 +109,10 @@ builder.Services.AddSwaggerGen(options =>
|
|||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
// Configure the HTTP request pipeline.
|
||||||
if (app.Environment.IsDevelopment())
|
if (!app.Environment.IsDevelopment())
|
||||||
{
|
{
|
||||||
//app.MapOpenApi();
|
//app.MapOpenApi();
|
||||||
|
builder.WebHost.UseUrls("http://0.0.0.0:8080");
|
||||||
}
|
}
|
||||||
|
|
||||||
app.UseSwagger();
|
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