26 lines
1.2 KiB
Docker
26 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.
|
|
|
|
# This stage is used when running from VS in fast mode (Default for Debug configuration)
|
|
#FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
|
ARG BUILD_CONFIGURATION=Release
|
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
|
WORKDIR /src
|
|
COPY ["FamilyTreeAPI/FamilyTreeAPI.csproj", "FamilyTreeAPI/"]
|
|
COPY ["CommonAD/CommonAD.csproj", "CommonAD/"]
|
|
RUN dotnet restore "./FamilyTreeAPI/FamilyTreeAPI.csproj"
|
|
COPY . .
|
|
WORKDIR "/src/FamilyTreeAPI"
|
|
RUN dotnet build "./FamilyTreeAPI.csproj" -c Release -o /app/build
|
|
|
|
# This stage is used to publish the service project to be copied to the final stage
|
|
FROM build AS publish
|
|
|
|
RUN dotnet publish "./FamilyTreeAPI.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
|
|
|
# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration)
|
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
|
WORKDIR /app
|
|
ENV ASPNETCORE_HTTP_PORTS=80
|
|
EXPOSE 80
|
|
COPY --from=publish /app/publish .
|
|
ENTRYPOINT ["dotnet", "FamilyTreeAPI.dll"] |