refactor: migrate from nginx to aspnet runtime
Some checks failed
Build and Deploy / build (push) Failing after 13s
Some checks failed
Build and Deploy / build (push) Failing after 13s
This commit is contained in:
@@ -1,24 +1,15 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY ["FrontOffice.Main/NuGet.config", "NuGet.config"]
|
COPY src/*.sln ./ 2>/dev/null || true
|
||||||
COPY ["FrontOffice.Main/FrontOffice.Main.csproj", "FrontOffice.Main/"]
|
COPY src/*/*.csproj ./
|
||||||
RUN dotnet restore "FrontOffice.Main/FrontOffice.Main.csproj" --configfile NuGet.config
|
RUN for file in *.csproj; do mkdir -p "${file%.*}" && mv "$file" "${file%.*}/"; done 2>/dev/null || true
|
||||||
COPY . .
|
RUN dotnet restore "FrontOffice/FrontOffice.csproj" || dotnet restore
|
||||||
WORKDIR "/src/FrontOffice.Main"
|
COPY src/ ./
|
||||||
RUN dotnet publish "./FrontOffice.Main.csproj" -c Release -o /app/publish
|
RUN dotnet publish "FrontOffice/FrontOffice.csproj" -c Release -o /app/publish
|
||||||
|
|
||||||
FROM nginx:alpine AS final
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
|
||||||
WORKDIR /usr/share/nginx/html
|
WORKDIR /app
|
||||||
COPY --from=build /app/publish/wwwroot .
|
COPY --from=build /app/publish .
|
||||||
COPY <<'NGINX_CONF' /etc/nginx/conf.d/default.conf
|
ENV ASPNETCORE_URLS=http://+:8080
|
||||||
server {
|
EXPOSE 8080
|
||||||
listen 80;
|
ENTRYPOINT ["dotnet", "FrontOffice.dll"]
|
||||||
server_name _;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
NGINX_CONF
|
|
||||||
EXPOSE 80
|
|
||||||
|
|||||||
Reference in New Issue
Block a user