ow
This commit is contained in:
1 parent
501c92d87c
commit
f1a88acb89
9 files changed
+1040
-165
No files matched your search
@@ -5,35 +5,17 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
|
||||
|
||||
# 此階段是用來組建服務專案
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["CloudBuilder.Web.Entry/CloudBuilder.Web.Entry.csproj", "CloudBuilder.Web.Entry/"]
|
||||
RUN dotnet restore "./CloudBuilder.Web.Entry/CloudBuilder.Web.Entry.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/CloudBuilder.Web.Entry"
|
||||
RUN dotnet build "./CloudBuilder.Web.Entry.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
# 此階段可用來發佈要複製到最終階段的服務專案
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "./CloudBuilder.Web.Entry.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
|
||||
# 此階段用於生產環境,或以一般模式從 VS 執行時 (未使用偵錯設定時的預設值)
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=publish /app/publish .
|
||||
COPY ./dist ./dist
|
||||
ENTRYPOINT ["dotnet", "CloudBuilder.Web.Entry.dll"]
|
||||
|
||||
#version: "3"
|
||||
#services:
|
||||
#cb:
|
||||
#image: mcr.microsoft.com/dotnet/runtime-deps:8.0
|
||||
#container_name: CloudBuilder.Web.Entry
|
||||
#build: .
|
||||
#container_name: youjiala.com
|
||||
#restart: always
|
||||
#ports:
|
||||
#- "5200:8080"
|
||||
|
||||
Reference in new issue
Block a user