From 06e706d976121e35563aecdb826e7710600e8d90 Mon Sep 17 00:00:00 2001 From: YuChia Date: Thu, 23 Nov 2023 19:15:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AA=BF=E6=95=B4=20dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dotnet.WebApi/Dockerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/dotnet.WebApi/Dockerfile b/src/dotnet.WebApi/Dockerfile index 0d64824..d2ad254 100644 --- a/src/dotnet.WebApi/Dockerfile +++ b/src/dotnet.WebApi/Dockerfile @@ -1,8 +1,9 @@ FROM ghcr.io/yuchia-wei/otel-dotnet-auto-instrumentation:8.0-bookworm-slim AS base #FROM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim AS base WORKDIR /app +EXPOSE 80 EXPOSE 8080 -EXPOSE 8443 +EXPOSE 443 FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS build WORKDIR /src @@ -16,10 +17,14 @@ COPY ["dotnet.WebApi/dotnet.WebApi.csproj", "dotnet.WebApi/"] RUN dotnet restore "dotnet.WebApi/dotnet.WebApi.csproj" COPY . . WORKDIR "/src/dotnet.WebApi" -RUN dotnet build "dotnet.WebApi.csproj" -c Release -o /app/build +RUN dotnet build "dotnet.WebApi.csproj" \ + -c Release \ + -o /app/build FROM build AS publish -RUN dotnet publish "dotnet.WebApi.csproj" -c Release -o /app/publish +RUN dotnet publish "dotnet.WebApi.csproj" \ + -c Release \ + -o /app/publish FROM base AS final WORKDIR /app