|
@@ -1,25 +1,27 @@
|
|
#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.
|
|
#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 mcr.microsoft.com/dotnet/aspnet:8.0-nanoserver-1809 AS base
|
|
|
|
|
|
+FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
|
|
|
+USER app
|
|
WORKDIR /app
|
|
WORKDIR /app
|
|
EXPOSE 8080
|
|
EXPOSE 8080
|
|
EXPOSE 8081
|
|
EXPOSE 8081
|
|
|
|
|
|
-FROM mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-1809 AS build
|
|
|
|
|
|
+FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
|
ARG BUILD_CONFIGURATION=Release
|
|
ARG BUILD_CONFIGURATION=Release
|
|
WORKDIR /src
|
|
WORKDIR /src
|
|
COPY ["MTWorkHR.API/MTWorkHR.API.csproj", "MTWorkHR.API/"]
|
|
COPY ["MTWorkHR.API/MTWorkHR.API.csproj", "MTWorkHR.API/"]
|
|
|
|
+COPY ["MTWorkHR.Application/MTWorkHR.Application.csproj", "MTWorkHR.Application/"]
|
|
|
|
+COPY ["MTWorkHR.Core/MTWorkHR.Core.csproj", "MTWorkHR.Core/"]
|
|
|
|
+COPY ["MTWorkHR.Identity/MTWorkHR.Identity.csproj", "MTWorkHR.Identity/"]
|
|
|
|
+COPY ["MTWorkHR.Infrastructure/MTWorkHR.Infrastructure.csproj", "MTWorkHR.Infrastructure/"]
|
|
RUN dotnet restore "./MTWorkHR.API/./MTWorkHR.API.csproj"
|
|
RUN dotnet restore "./MTWorkHR.API/./MTWorkHR.API.csproj"
|
|
COPY . .
|
|
COPY . .
|
|
WORKDIR "/src/MTWorkHR.API"
|
|
WORKDIR "/src/MTWorkHR.API"
|
|
-RUN dotnet build "./MTWorkHR.API.csproj" -c %BUILD_CONFIGURATION% -o /app/build
|
|
|
|
|
|
+RUN dotnet build "./MTWorkHR.API.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
|
|
|
|
|
FROM build AS publish
|
|
FROM build AS publish
|
|
ARG BUILD_CONFIGURATION=Release
|
|
ARG BUILD_CONFIGURATION=Release
|
|
-RUN dotnet publish "./MTWorkHR.API.csproj" -c %BUILD_CONFIGURATION% -o /app/publish /p:UseAppHost=false
|
|
|
|
|
|
+RUN dotnet publish "./MTWorkHR.API.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
|
|
|
|
|
FROM base AS final
|
|
FROM base AS final
|
|
WORKDIR /app
|
|
WORKDIR /app
|