Skip to content

Commit 5aab791

Browse files
committed
feat(webapp): add Dockerfile for web application
1 parent 470213a commit 5aab791

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
2+
WORKDIR /src
3+
4+
# copy solution and project files
5+
COPY ["PayrollEngine.WebApp.sln", "./"]
6+
COPY ["Core/PayrollEngine.WebApp.Core.csproj", "Core/"]
7+
COPY ["Presentation/PayrollEngine.WebApp.Presentation.csproj", "Presentation/"]
8+
COPY ["Server/PayrollEngine.WebApp.Server.csproj", "Server/"]
9+
COPY ["Shared/PayrollEngine.WebApp.Shared.csproj", "Shared/"]
10+
COPY ["ViewModel/PayrollEngine.WebApp.ViewModel.csproj", "ViewModel/"]
11+
12+
# copy Directory.Build.props
13+
COPY ["Directory.Build.props", "./"]
14+
15+
RUN dotnet restore "PayrollEngine.WebApp.sln"
16+
17+
# copy everything else
18+
COPY . .
19+
WORKDIR "/src/Server"
20+
RUN dotnet publish "PayrollEngine.WebApp.Server.csproj" -c Release -o /app/publish --no-restore
21+
22+
# final stage
23+
FROM mcr.microsoft.com/dotnet/aspnet:8.0
24+
WORKDIR /app
25+
COPY --from=build /app/publish .
26+
ENTRYPOINT ["dotnet", "PayrollEngine.WebApp.Server.dll"]

0 commit comments

Comments
 (0)