25 lines
746 B
Docker
25 lines
746 B
Docker
# Use the official image as a parent image
|
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
|
WORKDIR /app
|
|
EXPOSE 80
|
|
EXPOSE 443
|
|
|
|
# Use SDK image to build the project
|
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
|
WORKDIR /src
|
|
COPY ["HealthcareManagerUI/HealthcareManagerUI.csproj", "HealthcareManagerUI/"]
|
|
RUN dotnet restore "HealthcareManagerUI/HealthcareManagerUI.csproj"
|
|
COPY . .
|
|
WORKDIR "/src/HealthcareManagerUI"
|
|
RUN dotnet build "HealthcareManagerUI.csproj" -c Release -o /app/build
|
|
|
|
# Publish the project
|
|
FROM build AS publish
|
|
RUN dotnet publish "HealthcareManagerUI.csproj" -c Release -o /app/publish
|
|
|
|
# Build runtime image
|
|
FROM base AS final
|
|
WORKDIR /app
|
|
COPY --from=publish /app/publish .
|
|
ENTRYPOINT ["dotnet", "HealthcareManagerUI.dll"]
|