-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
23 lines (20 loc) · 952 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM mcr.microsoft.com/dotnet/aspnet:7.0 as base
ARG PORT
ENV ASPNETCORE_URLS=http://+:$PORT
ENV ASPNETCORE_ENVIRONMENT=Development
WORKDIR /App
EXPOSE $PORT
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["AdvancedSystems.Backend/AdvancedSystems.Backend.csproj", "AdvancedSystems.Backend/nuget.config", "AdvancedSystems.Backend/"]
RUN dotnet restore "AdvancedSystems.Backend/AdvancedSystems.Backend.csproj" --configfile "AdvancedSystems.Backend/nuget.config" --verbosity minimal
COPY . .
WORKDIR "/src/AdvancedSystems.Backend"
RUN dotnet build "AdvancedSystems.Backend.csproj" --configuration Release --output "/App/Build"
FROM build AS publish
RUN dotnet publish "AdvancedSystems.Backend.csproj" --configuration Release --output "/App/Publish" --no-restore --nologo
FROM base AS final
WORKDIR /App
COPY --from=publish /App/Publish .
RUN echo "Publish AdvancedSystems.Backend"
ENTRYPOINT ["dotnet", "AdvancedSystems.Backend.dll"]