Skip to content

Commit e5dd2f7

Browse files
committed
simpler dockerfile
1 parent c943d41 commit e5dd2f7

File tree

1 file changed

+11
-23
lines changed

1 file changed

+11
-23
lines changed
Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,20 @@
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)
71
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS dev
82
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"]
148

15-
# Build
169
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
1710
WORKDIR /src
18-
COPY ShowcaseProject/ShowcaseFrontend/ShowcaseFrontend.csproj ShowcaseFrontend/
11+
COPY ShowcaseFrontend/ShowcaseFrontend.csproj ShowcaseFrontend/
1912
RUN dotnet restore ShowcaseFrontend/ShowcaseFrontend.csproj
20-
COPY ShowcaseProject/ShowcaseFrontend/. ShowcaseFrontend/
13+
COPY ShowcaseFrontend/. ShowcaseFrontend/
2114
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
2716

28-
# Final
29-
FROM base AS final
17+
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
3018
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

Comments
 (0)