修改h3的dockerfile

This commit is contained in:
token
2024-02-16 17:30:42 +08:00
parent 4fc8d29e32
commit cbf727ecd7
+8 -5
View File
@@ -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