-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 774 Bytes
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /app
COPY . .
RUN dotnet build CreatePdf.NET/CreatePdf.NET.csproj -c Release
RUN dotnet new console -n Demo -o /demo
WORKDIR /demo
RUN dotnet add reference /app/CreatePdf.NET/CreatePdf.NET.csproj
RUN echo 'using CreatePdf.NET.Public;\n\
\n\
await Pdf.Create()\n\
.AddText("Hello from Docker!", color: Dye.Blue, size: TextSize.Large)\n\
.AddLine()\n\
.AddText("CreatePdf.NET Demo")\n\
.AddLine()\n\
.AddPixelText("Running in a container!", Dye.Green)\n\
.SaveAsync("docker-demo");\n\
\n\
Console.WriteLine("PDF created successfully!");' > Program.cs
RUN groupadd -r appuser && useradd -r -g appuser appuser
RUN chown -R appuser:appuser /demo
USER appuser
ENTRYPOINT ["dotnet", "run"]