-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (25 loc) · 878 Bytes
/
Dockerfile
File metadata and controls
29 lines (25 loc) · 878 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
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
WORKDIR /app
EXPOSE 5898
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY ["HyPlayer.Web/HyPlayer.Web.csproj", "HyPlayer.Web/"]
RUN dotnet restore "HyPlayer.Web/HyPlayer.Web.csproj"
COPY ["HyPlayer.Web/", "HyPlayer.Web/"]
WORKDIR "/src/HyPlayer.Web"
RUN dotnet build "HyPlayer.Web.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "HyPlayer.Web.csproj" -c Release -o /app/publish
FROM node:20-slim AS frontbuild
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
COPY ["HyPlayer.Web.Frontend/", "/app"]
WORKDIR /app
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --force
RUN pnpm run build
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
COPY --from=frontbuild /app/dist /app/wwwroot
ENTRYPOINT ["dotnet", "HyPlayer.Web.dll"]