DamageAssessment_Backend/DamageAssesmentApi/DamageAssesment.Api.Surveys/Dockerfile

26 lines
1.0 KiB
Docker
Raw Normal View History

2023-08-29 21:23:40 -05:00
##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.
2023-08-28 00:03:24 -05:00
2023-08-29 21:23:40 -05:00
# Use the ASP.NET runtime image as the base image
2023-08-28 00:03:24 -05:00
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
2023-08-29 21:23:40 -05:00
# Use the .NET SDK image for the build stage
2023-08-28 00:03:24 -05:00
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["DamageAssesment.Api.Surveys/DamageAssesment.Api.Survey.csproj", "DamageAssesment.Api.Surveys/"]
RUN dotnet restore "DamageAssesment.Api.Surveys/DamageAssesment.Api.Survey.csproj"
COPY . .
WORKDIR "/src/DamageAssesment.Api.Surveys"
RUN dotnet build "DamageAssesment.Api.Survey.csproj" -c Release -o /app/build
2023-08-29 21:23:40 -05:00
# Publish the application
2023-08-28 00:03:24 -05:00
FROM build AS publish
RUN dotnet publish "DamageAssesment.Api.Survey.csproj" -c Release -o /app/publish /p:UseAppHost=false
2023-08-29 21:23:40 -05:00
# Use the ASP.NET runtime image again for the final stage
2023-08-28 00:03:24 -05:00
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
2023-08-29 21:23:40 -05:00
ENTRYPOINT ["dotnet", "DamageAssesment.Api.Survey.dll"]