-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
35 lines (28 loc) · 1.08 KB
/
Dockerfile
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
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG TARGETARCH
WORKDIR /app
# Install Node.js
RUN apt-get update \
&& apt-get install -y ca-certificates curl gnupg \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update \
&& apt-get install nodejs -y
WORKDIR /src
COPY ["Web/Web.csproj", "Web/"]
RUN dotnet restore "Web/Web.csproj" -a $TARGETARCH
WORKDIR "/src/Web"
COPY ./Web .
RUN dotnet publish "Web.csproj" -a $TARGETARCH -c Release --no-restore --self-contained false -o /app/publish
FROM mcr.microsoft.com/dotnet/aspnet:8.0
# Needed when csproj is .NET 7
ENV DOTNET_ROLL_FORWARD=Major
# With .Net 8 default port changed
ENV ASPNETCORE_HTTP_PORTS=80
WORKDIR /app
COPY --from=build /app/publish .
VOLUME /config
EXPOSE 80
EXPOSE 443
ENTRYPOINT ["dotnet", "pledo.dll"]