Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 8 additions & 26 deletions ShowcaseProject/ShowcaseFrontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,20 @@
# Base image with only runtime (for production)
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 8080
EXPOSE 8081

# Development stage with full .NET SDK for hot reload
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS dev
WORKDIR /app

# Copy only the project files first to leverage Docker cache
COPY ShowcaseFrontend/ShowcaseFrontend.csproj ShowcaseFrontend/
RUN dotnet restore ShowcaseFrontend/ShowcaseFrontend.csproj

# Copy the rest of the source code
COPY ShowcaseFrontend/. ShowcaseFrontend/

WORKDIR /app/ShowcaseFrontend
CMD ["dotnet", "watch", "run", "--project", "/app/ShowcaseFrontend/ShowcaseFrontend.csproj", "--no-launch-profile", "--urls=http://0.0.0.0:80"]
CMD ["dotnet", "watch", "run", "--no-launch-profile", "--urls", "http://0.0.0.0:80"]

# Build stage for production
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ShowcaseProject/ShowcaseFrontend/ShowcaseFrontend.csproj ShowcaseFrontend/
RUN dotnet restore "./ShowcaseFrontend/ShowcaseFrontend.csproj"
COPY ShowcaseProject/ShowcaseFrontend/. ShowcaseFrontend/
WORKDIR "/src/ShowcaseFrontend"
RUN dotnet build "./ShowcaseFrontend.csproj" -c Release -o /app/build

# Publish stage
FROM build AS publish
RUN dotnet publish "./ShowcaseFrontend.csproj" -c Release -o /app/publish /p:UseAppHost=false
COPY ShowcaseFrontend/ShowcaseFrontend.csproj ShowcaseFrontend/
RUN dotnet restore ShowcaseFrontend/ShowcaseFrontend.csproj
COPY ShowcaseFrontend/. ShowcaseFrontend/
WORKDIR /src/ShowcaseFrontend
RUN dotnet publish -c Release -o /app/publish /p:UseAppHost=false

# Final production stage
FROM base AS final
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
WORKDIR /app
COPY --from=publish /app/publish .
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "ShowcaseFrontend.dll"]
1 change: 1 addition & 0 deletions ShowcaseProject/ShowcaseFrontend/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<img class="person-logo" src="images/ErikL.jpg">
<h1 class="person-name">Erik Leusink</h1>
<h2>Over mijzelf</h2>
<h3><b>Test voor acceptatie</b></h3>
<p class="personalia-content__description">
Enthousiaste afgestudeerde Media- en Applicatie ontwikkelaar en 24 jaar oud. Op dit moment studeer ik aan het Windesheim College te Zwolle, hier volg ik de opleiding HBO ICT, met als afstudeer richting Software Engineering.
<p>
Expand Down