Skip to content

Commit

Permalink
調整 dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
YuChia-Wei committed Nov 23, 2023
1 parent 7b31cce commit 06e706d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/dotnet.WebApi/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit 06e706d

Please sign in to comment.