This commit is contained in:
andrei-mihnea-cerbu
2024-04-09 02:04:37 +03:00
parent 015a1a9c09
commit 0d03c0ea43
92 changed files with 8842 additions and 302 deletions
+24
View File
@@ -0,0 +1,24 @@
# 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 ["API/API.csproj", "API/"]
RUN dotnet restore "API/API.csproj"
COPY . .
WORKDIR "/src/API"
RUN dotnet build "API.csproj" -c Release -o /app/build
# Publish the project
FROM build AS publish
RUN dotnet publish "API.csproj" -c Release -o /app/publish
# Build runtime image
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "API.dll"]