|
1 | | -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base |
2 | | -WORKDIR /app |
3 | | -EXPOSE 8080 |
4 | | -EXPOSE 8081 |
5 | | - |
6 | | -# Dev (hot reload) |
7 | 1 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS dev |
8 | 2 | WORKDIR /app |
9 | | -COPY ShowcaseProject/ShowcaseFrontend/ShowcaseFrontend.csproj ShowcaseProject/ShowcaseFrontend/ |
10 | | -RUN dotnet restore ShowcaseProject/ShowcaseFrontend/ShowcaseFrontend.csproj |
11 | | -COPY ShowcaseProject/ShowcaseFrontend/. ShowcaseProject/ShowcaseFrontend/ |
12 | | -WORKDIR /app/ShowcaseProject/ShowcaseFrontend |
13 | | -CMD ["dotnet","watch","run","--project","/app/ShowcaseProject/ShowcaseFrontend/ShowcaseFrontend.csproj","--no-launch-profile","--urls=http://0.0.0.0:80"] |
| 3 | +COPY ShowcaseFrontend/ShowcaseFrontend.csproj ShowcaseFrontend/ |
| 4 | +RUN dotnet restore ShowcaseFrontend/ShowcaseFrontend.csproj |
| 5 | +COPY ShowcaseFrontend/. ShowcaseFrontend/ |
| 6 | +WORKDIR /app/ShowcaseFrontend |
| 7 | +CMD ["dotnet", "watch", "run", "--no-launch-profile", "--urls", "http://0.0.0.0:80"] |
14 | 8 |
|
15 | | -# Build |
16 | 9 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build |
17 | 10 | WORKDIR /src |
18 | | -COPY ShowcaseProject/ShowcaseFrontend/ShowcaseFrontend.csproj ShowcaseFrontend/ |
| 11 | +COPY ShowcaseFrontend/ShowcaseFrontend.csproj ShowcaseFrontend/ |
19 | 12 | RUN dotnet restore ShowcaseFrontend/ShowcaseFrontend.csproj |
20 | | -COPY ShowcaseProject/ShowcaseFrontend/. ShowcaseFrontend/ |
| 13 | +COPY ShowcaseFrontend/. ShowcaseFrontend/ |
21 | 14 | WORKDIR /src/ShowcaseFrontend |
22 | | -RUN dotnet build ShowcaseFrontend.csproj -c Release -o /app/build |
23 | | - |
24 | | -# Publish |
25 | | -FROM build AS publish |
26 | | -RUN dotnet publish ShowcaseFrontend.csproj -c Release -o /app/publish /p:UseAppHost=false |
| 15 | +RUN dotnet publish -c Release -o /app/publish /p:UseAppHost=false |
27 | 16 |
|
28 | | -# Final |
29 | | -FROM base AS final |
| 17 | +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final |
30 | 18 | WORKDIR /app |
31 | | -COPY --from=publish /app/publish . |
32 | | -ENTRYPOINT ["dotnet","ShowcaseFrontend.dll"] |
| 19 | +COPY --from=build /app/publish . |
| 20 | +ENTRYPOINT ["dotnet", "ShowcaseFrontend.dll"] |
0 commit comments