2023-08-28 00:03:24 -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-29 21:23:40 -05:00
# Use the ASP.NET 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 SDK image for building
2023-08-28 00:03:24 -05:00
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
2023-08-29 21:23:40 -05:00
# Copy the project file and restore dependencies
2023-08-28 00:03:24 -05:00
COPY [ "DamageAssesment.Api.Answers/DamageAssesment.Api.Answers.csproj" , "DamageAssesment.Api.Answers/" ]
RUN dotnet restore "DamageAssesment.Api.Answers/DamageAssesment.Api.Answers.csproj"
2023-08-29 21:23:40 -05:00
# Copy the source code
2023-08-28 00:03:24 -05:00
COPY . .
WORKDIR "/src/DamageAssesment.Api.Answers"
2023-08-29 21:23:40 -05:00
# Build the application
2023-08-28 00:03:24 -05:00
RUN dotnet build "DamageAssesment.Api.Answers.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.Answers.csproj" -c Release -o /app/publish /p:UseAppHost= false
2023-08-29 21:23:40 -05:00
# Set up the final image
2023-08-28 00:03:24 -05:00
FROM base AS final
WORKDIR /app
2023-08-29 21:23:40 -05:00
# Copy the published files
2023-08-28 00:03:24 -05:00
COPY --from= publish /app/publish .
2023-08-29 21:23:40 -05:00
## Set up the volume and copy the XML comments
#VOLUME /xmlcomments
#COPY ["DamageAssesment.Api.Answers.xml", "/xmlcomments/DamageAssesment.Api.Answers.xml"]
#
# Specify the entry point for the container
ENTRYPOINT [ "dotnet" , "DamageAssesment.Api.Answers.dll" ]