-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
34 lines (30 loc) · 1.53 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
#FROM mcr.microsoft.com/dotnet/aspnet:8.0-bullseye-slim-amd64 AS build
##Also install dotnet 3.1
##RUN curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin -Channel 3.1 -InstallDir /usr/share/dotnet
##RUN apt update && apt install libfreetype6 -y
FROM nginx:stable-alpine AS base
COPY ./DeveMazeGeneratorCore.MonoGame.Blazor/nginxconfig/nginx.conf /etc/nginx/nginx.conf
#FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["DeveMazeGeneratorCore.MonoGame.Blazor/DeveMazeGeneratorCore.MonoGame.Blazor.csproj", "DeveMazeGeneratorCore.MonoGame.Blazor/"]
RUN dotnet restore "DeveMazeGeneratorCore.MonoGame.Blazor/DeveMazeGeneratorCore.MonoGame.Blazor.csproj"
COPY . .
WORKDIR "/src/DeveMazeGeneratorCore.MonoGame.Blazor"
RUN dotnet build "DeveMazeGeneratorCore.MonoGame.Blazor.csproj" -c Release -o /app/build
FROM build AS publish
ARG BUILD_VERSION
ARG VER=${BUILD_VERSION:-1.0.0}
RUN dotnet publish "DeveMazeGeneratorCore.MonoGame.Blazor.csproj" -c Release -o /app/publish /p:Version=$VER /p:UseAppHost=false
FROM base AS final
WORKDIR /usr/share/nginx/html
COPY --from=publish /app/publish/wwwroot .
CMD ["nginx", "-g", "daemon off;"]
#FROM base AS final
#WORKDIR /app
#COPY --from=publish /root/.nuget/packages/microsoft.aspnetcore.components.webassembly.devserver/6.0.2/tools .
#COPY --from=publish /app/publish .
#ENTRYPOINT ["dotnet", "blazor-devserver.dll", "--applicationpath", "DeveMazeGeneratorCore.MonoGame.Blazor.dll"]