-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWebPanel.Dockerfile
More file actions
42 lines (35 loc) · 1.32 KB
/
WebPanel.Dockerfile
File metadata and controls
42 lines (35 loc) · 1.32 KB
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
32
33
34
35
36
37
38
39
40
41
42
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base-pkg
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gnupg \
apt-transport-https \
ca-certificates \
adduser \
curl \
fonts-recommended fontconfig fonts-noto-cjk fonts-noto-cjk-extra fonts-liberation fonts-dejavu \
&& rm -rf /var/lib/apt/lists/*
ADD localfonts.conf /etc/fonts/local.conf
RUN fc-cache -f -v
FROM base-pkg AS base
WORKDIR /app
EXPOSE 80 8080
# Creates a non-root user with an explicit UID and adds permission to access the /app folder
# For more info, please refer to https://aka.ms/vscode-docker-dotnet-configure-containers
RUN /usr/sbin/adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
USER appuser
# --- compile project ---
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
RUN dotnet tool install -g dotnet-t4
ENV PATH="/root/.dotnet/tools:${PATH}"
WORKDIR /src
COPY . ./
RUN dotnet restore "XeniaBot.WebPanel/XeniaBot.WebPanel.csproj"
WORKDIR "/src/."
RUN dotnet build "./XeniaBot.WebPanel/XeniaBot.WebPanel.csproj" -c Release -o /app/build
# --- publish project ---
FROM build AS publish
RUN dotnet publish "./XeniaBot.WebPanel/XeniaBot.WebPanel.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "XeniaBot.WebPanel.dll"]