Skip to content

Commit db02a75

Browse files
Add Dockerfile and build infrastructure for Blazor Server app
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
1 parent 3ae4525 commit db02a75

4 files changed

Lines changed: 89 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
**/.classpath
2+
**/.dockerignore
3+
**/.env
4+
**/.git
5+
**/.gitignore
6+
**/.project
7+
**/.settings
8+
**/.toolstarget
9+
**/.vs
10+
**/.vscode
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md
26+
.playwright/
27+
playwright-report/
28+
test-results/
29+
screenshot-*.png
Binary file not shown.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM stuartferguson/txnprocbase AS base
2+
WORKDIR /app
3+
4+
# This stage is used to build the service project
5+
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
6+
ARG BUILD_CONFIGURATION=Release
7+
WORKDIR /src
8+
9+
# Install Node.js for Tailwind CSS build
10+
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
11+
apt-get install -y nodejs
12+
13+
COPY ["EstateManagementUI.BlazorServer/NuGet.Config", "."]
14+
COPY ["EstateManagementUI.BlazorServer/Certificates/*.*", "Certificates/"]
15+
COPY ["EstateManagementUI.BlazorServer/EstateManagementUI.BlazorServer.csproj", "EstateManagementUI.BlazorServer/"]
16+
RUN dotnet restore "./EstateManagementUI.BlazorServer/EstateManagementUI.BlazorServer.csproj"
17+
18+
COPY . .
19+
WORKDIR "/src/EstateManagementUI.BlazorServer"
20+
21+
# Install npm packages and build Tailwind CSS
22+
RUN npm install
23+
RUN npm run css:build
24+
25+
RUN dotnet build "./EstateManagementUI.BlazorServer.csproj" -c $BUILD_CONFIGURATION -o /app/build
26+
27+
# This stage is used to publish the service project to be copied to the final stage
28+
FROM build AS publish
29+
ARG BUILD_CONFIGURATION=Release
30+
RUN dotnet publish "./EstateManagementUI.BlazorServer.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
31+
32+
# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration)
33+
FROM base AS final
34+
WORKDIR /app
35+
COPY --from=publish /app/publish .
36+
ENTRYPOINT ["dotnet", "EstateManagementUI.BlazorServer.dll"]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="Feedz" value="https://f.feedz.io/transactionprocessing/nugets/nuget/index.json" />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
6+
</packageSources>
7+
<packageSourceCredentials>
8+
<Feedz>
9+
<add key="Username" value="TestUser"/>
10+
<add key="ClearTextPassword" value="T-jXeJSPLLjOdZvRZOQ5O2e1vrQwRI7uxC1U" />
11+
</Feedz>
12+
</packageSourceCredentials>
13+
<packageRestore>
14+
<add key="enabled" value="True" />
15+
<add key="automatic" value="True" />
16+
</packageRestore>
17+
<bindingRedirects>
18+
<add key="skip" value="False" />
19+
</bindingRedirects>
20+
<packageManagement>
21+
<add key="format" value="0" />
22+
<add key="disabled" value="False" />
23+
</packageManagement>
24+
</configuration>

0 commit comments

Comments
 (0)