-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
61 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. | ||
|
||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base | ||
# apt update and install fonts | ||
RUN echo "deb http://deb.debian.org/debian/ bookworm main contrib" > /etc/apt/sources.list && \ | ||
echo "deb-src http://deb.debian.org/debian/ bookworm main contrib" >> /etc/apt/sources.list && \ | ||
echo "deb http://security.debian.org/ bookworm-security main contrib" >> /etc/apt/sources.list && \ | ||
echo "deb-src http://security.debian.org/ bookworm-security main contrib" >> /etc/apt/sources.list | ||
RUN sed -i'.bak' 's/$/ contrib/' /etc/apt/sources.list | ||
RUN apt-get update; apt-get install -y ttf-mscorefonts-installer fontconfig | ||
RUN apt-get install -y fonts-noto-cjk fontconfig openssl | ||
|
||
|
||
|
||
# Generate a self-signed certificate | ||
RUN mkdir -p /app/https && \ | ||
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \ | ||
-keyout /app/https/private.key -out /app/https/certificate.crt \ | ||
-subj "/C=US/ST=State/L=City/O=Organization/CN=localhost" && \ | ||
openssl pkcs12 -export -out /app/https/aspnetapp.pfx \ | ||
-inkey /app/https/private.key -in /app/https/certificate.crt \ | ||
-password pass:CREDENTIAL_PLACEHOLDER | ||
|
||
|
||
# Setup environment variables for the application to find the certificate | ||
ENV ASPNETCORE_URLS=http://+:80;https://+:443 | ||
ENV ASPNETCORE_Kestrel__Certificates__Default__Password="CREDENTIAL_PLACEHOLDER" | ||
ENV ASPNETCORE_Kestrel__Certificates__Default__Path="/app/https/aspnetapp.pfx" | ||
|
||
WORKDIR /app | ||
EXPOSE 80 | ||
EXPOSE 443 | ||
|
||
|
||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
ARG BUILD_CONFIGURATION=Release | ||
WORKDIR /src | ||
|
||
COPY ["src/Blazor.Server.UI/Blazor.Server.UI.csproj", "src/Blazor.Server.UI/"] | ||
COPY ["src/Application/Application.csproj", "src/Application/"] | ||
COPY ["src/Domain/Domain.csproj", "src/Domain/"] | ||
COPY ["src/Infrastructure/Infrastructure.csproj", "src/Infrastructure/"] | ||
RUN dotnet restore "src/Blazor.Server.UI/Blazor.Server.UI.csproj" | ||
COPY . . | ||
|
||
WORKDIR "/src/src/Blazor.Server.UI" | ||
RUN dotnet add package SkiaSharp.NativeAssets.Linux.NoDependencies | ||
RUN dotnet add package HarfBuzzSharp.NativeAssets.Linux | ||
RUN dotnet build "Blazor.Server.UI.csproj" -c $BUILD_CONFIGURATION -o /app/build | ||
|
||
FROM build AS publish | ||
ARG BUILD_CONFIGURATION=Release | ||
RUN dotnet publish "Blazor.Server.UI.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
|
||
ENTRYPOINT ["dotnet", "Blazor.Server.UI.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.