idk why it works now, help
This commit is contained in:
45
Dockerfile
45
Dockerfile
@@ -1,33 +1,20 @@
|
||||
#FROM mcr.microsoft.com/dotnet/sdk:7.0 AS base
|
||||
#WORKDIR /app
|
||||
#
|
||||
#FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
|
||||
#COPY ../ /src/
|
||||
#WORKDIR /src
|
||||
#RUN dotnet build "MauMau-Server.csproj" -c Release -o out
|
||||
#
|
||||
#FROM build AS publish
|
||||
#RUN dotnet publish "MauMau-Server.csproj" -c Release -o /app/publish
|
||||
#
|
||||
#FROM base AS final
|
||||
#WORKDIR /app
|
||||
#COPY --from=publish /app/publish .
|
||||
#ENTRYPOINT ["dotnet", "MauMau-Server.dll"]
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
COPY *.csproj .
|
||||
RUN dotnet restore --use-current-runtime
|
||||
|
||||
# copy everything else and build app
|
||||
WORKDIR /src
|
||||
COPY ["MauMau-Server/MauMau-Server.csproj", "MauMau-Server/"]
|
||||
RUN dotnet restore "MauMau-Server/MauMau-Server.csproj"
|
||||
COPY . .
|
||||
RUN dotnet publish -c Release -o /out --use-current-runtime --self-contained false --no-restore
|
||||
WORKDIR "/src/MauMau-Server"
|
||||
RUN dotnet build "MauMau-Server.csproj" -c Release -o /app/build
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
||||
COPY --from=build . .
|
||||
EXPOSE 5000
|
||||
CMD ["dotnet", "MauMau-Server.dll"]
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "MauMau-Server.csproj" -c Release -o /app/publish
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "MauMau-Server.dll"]
|
||||
Reference in New Issue
Block a user