Skip to content

Commit c943d41

Browse files
committed
test2
1 parent 6fcd564 commit c943d41

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed
Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,32 @@
1-
# Base image with only runtime (for production)
21
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
32
WORKDIR /app
43
EXPOSE 8080
54
EXPOSE 8081
65

7-
# Development stage with full .NET SDK for hot reload
6+
# Dev (hot reload)
87
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS dev
98
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"]
1014

11-
# Copy only the project files first to leverage Docker cache
12-
COPY ShowcaseFrontend/ShowcaseFrontend.csproj ShowcaseFrontend/
13-
RUN dotnet restore ShowcaseFrontend/ShowcaseFrontend.csproj
14-
15-
# Copy the rest of the source code
16-
COPY ShowcaseFrontend/. ShowcaseFrontend/
17-
18-
WORKDIR /app/ShowcaseFrontend
19-
CMD ["dotnet", "watch", "run", "--project", "/app/ShowcaseFrontend/ShowcaseFrontend.csproj", "--no-launch-profile", "--urls=http://0.0.0.0:80"]
20-
21-
# Build stage for production
15+
# Build
2216
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
2317
WORKDIR /src
2418
COPY ShowcaseProject/ShowcaseFrontend/ShowcaseFrontend.csproj ShowcaseFrontend/
25-
RUN dotnet restore "./ShowcaseFrontend/ShowcaseFrontend.csproj"
19+
RUN dotnet restore ShowcaseFrontend/ShowcaseFrontend.csproj
2620
COPY ShowcaseProject/ShowcaseFrontend/. ShowcaseFrontend/
27-
WORKDIR "/src/ShowcaseFrontend"
28-
RUN dotnet build "./ShowcaseFrontend.csproj" -c Release -o /app/build
21+
WORKDIR /src/ShowcaseFrontend
22+
RUN dotnet build ShowcaseFrontend.csproj -c Release -o /app/build
2923

30-
# Publish stage
24+
# Publish
3125
FROM build AS publish
32-
RUN dotnet publish "./ShowcaseFrontend.csproj" -c Release -o /app/publish /p:UseAppHost=false
26+
RUN dotnet publish ShowcaseFrontend.csproj -c Release -o /app/publish /p:UseAppHost=false
3327

34-
# Final production stage
28+
# Final
3529
FROM base AS final
3630
WORKDIR /app
3731
COPY --from=publish /app/publish .
38-
ENTRYPOINT ["dotnet", "ShowcaseFrontend.dll"]
32+
ENTRYPOINT ["dotnet","ShowcaseFrontend.dll"]

0 commit comments

Comments
 (0)