Files
SystemX.Web/Projects/VPKI/VPKI/VPKI.Web.Api/Dockerfile
2025-04-24 15:42:47 +09:00

35 lines
1.2 KiB
Docker

#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.
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat
FROM dotnet8 AS base
EXPOSE 5555
WORKDIR /
RUN mkdir /Config
RUN dotnet dev-certs https --trust
COPY ["Config/*", "/Config/"]
WORKDIR /app
FROM dotnet8 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["VPKI.Web.Api/VPKI.Web.Api.csproj", "VPKI.Web.Api/"]
COPY ["VPKI.Library.DB/VPKI.Library.DB.csproj", "VPKI.Library.DB/"]
COPY ["VPKI.Library/VPKI.Library.csproj", "VPKI.Library/"]
RUN dotnet restore "./VPKI.Web.Api/VPKI.Web.Api.csproj"
COPY . .
WORKDIR "/src/VPKI.Web.Api"
RUN dotnet build "./VPKI.Web.Api.csproj" -c %BUILD_CONFIGURATION% -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./VPKI.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", "VPKI.Web.Api.dll"]