DamageAssessment_Backend/DamageAssesmentApi/DamageAssesment.Api.Locations/Dockerfile

40 lines
1.3 KiB
Docker
Raw Normal View History

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.Locations/DamageAssesment.Api.Locations.csproj", "DamageAssesment.Api.Locations/"]
RUN dotnet restore "DamageAssesment.Api.Locations/DamageAssesment.Api.Locations.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.Locations"
2023-08-29 21:23:40 -05:00
# Build the application
2023-08-28 00:03:24 -05:00
RUN dotnet build "DamageAssesment.Api.Locations.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.Locations.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.Locations.xml", "/xmlcomments/DamageAssesment.Api.Locations.xml"]
# Specify the entry point for the container
ENTRYPOINT ["dotnet", "DamageAssesment.Api.Locations.dll"]