添加项目文件。
This commit is contained in:
40
Dockerfile
Normal file
40
Dockerfile
Normal file
@@ -0,0 +1,40 @@
|
||||
#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.
|
||||
#<23>ĵ<EFBFBD><C4B5><EFBFBD>ַ https://github.com/dotnet/dotnet-docker/
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
|
||||
#<23><>װapt-get <20><>װ libc6-dev , libgdiplus <20><><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>system.drawing <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,Ĭ<><C4AC>ubuntu<74><75><EFBFBD><EFBFBD>
|
||||
#RUN apt-get update -qq && apt-get -y install libgdiplus libc6-dev
|
||||
#<23><>װ curl
|
||||
RUN apt-get update && apt-get install -y curl
|
||||
|
||||
COPY ["src/BarCode.Web.Api/wwwroot/BarCode.Web.Api.xml", "/app/BarCode.Web.Api.xml"]
|
||||
COPY ["src/BarCode.Web.Api/wwwroot/BarCode.Web.Core.xml", "/app/BarCode.Web.Core.xml"]
|
||||
COPY ["src/BarCode.Web.Api/wwwroot/BarCode.Web.Domain.xml", "/app/BarCode.Web.Domain.xml"]
|
||||
|
||||
USER app
|
||||
|
||||
#FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["src/BarCode.Web.Api/BarCode.Web.Api.csproj", "src/BarCode.Web.Api/"]
|
||||
COPY ["src/BarCode.Web.Repositories/BarCode.Web.Repositories.csproj", "src/BarCode.Web.Repositories/"]
|
||||
COPY ["src/BarCode.Web.Core/BarCode.Web.Core.csproj", "src/BarCode.Web.Core/"]
|
||||
COPY ["src/BarCode.Web.Domain/BarCode.Web.Domain.csproj", "src/BarCode.Web.Domain/"]
|
||||
RUN dotnet restore "./src/BarCode.Web.Api/BarCode.Web.Api.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/src/BarCode.Web.Api"
|
||||
RUN dotnet build "./BarCode.Web.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "./BarCode.Web.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "BarCode.Web.Api.dll"]
|
||||
Reference in New Issue
Block a user