From cbf727ecd79f7fe414cedc6d66f61f2fda2dbd6a Mon Sep 17 00:00:00 2001 From: token <239573049@qq.com> Date: Fri, 16 Feb 2024 17:30:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9h3=E7=9A=84dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/FastGateway/Dockerfile-http3 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/FastGateway/Dockerfile-http3 b/src/FastGateway/Dockerfile-http3 index 96dabdc..8d197d8 100644 --- a/src/FastGateway/Dockerfile-http3 +++ b/src/FastGateway/Dockerfile-http3 @@ -1,3 +1,5 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + FROM mcr.microsoft.com/dotnet/aspnet:8.0.1-bookworm-slim-amd64 AS base USER root RUN apt update \ @@ -9,22 +11,23 @@ RUN apt update \ && apt-get install -y libmsquic \ && apt-get purge -y --auto-remove wget && apt-get clean && rm -rf /var/lib/apt/lists/* WORKDIR /app -EXPOSE 8000 +EXPOSE 5000 EXPOSE 8080 EXPOSE 8081 FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build ARG BUILD_CONFIGURATION=Release WORKDIR /src -COPY ["FastGateway/FastGateway.csproj", "FastGateway/"] -RUN dotnet restore "./FastGateway/./FastGateway.csproj" +COPY ["Directory.Build.props", "."] +COPY ["src/FastGateway/FastGateway.csproj", "src/FastGateway/"] +RUN dotnet restore "./src/FastGateway/FastGateway.csproj" COPY . . -WORKDIR "/src/FastGateway" +WORKDIR "/src/src/FastGateway" RUN dotnet build "./FastGateway.csproj" -c $BUILD_CONFIGURATION -o /app/build FROM build AS publish ARG BUILD_CONFIGURATION=Release -RUN dotnet publish "./FastGateway.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false --os linux +RUN dotnet publish "./FastGateway.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false FROM base AS final WORKDIR /app