another attempt that runs but is stuck in a loop?
This commit is contained in:
33
Dockerfile
Normal file
33
Dockerfile
Normal file
@@ -0,0 +1,33 @@
|
||||
#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"]
|
||||
|
||||
# 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
|
||||
COPY . .
|
||||
RUN dotnet publish -c Release -o /out --use-current-runtime --self-contained false --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
||||
COPY --from=build . .
|
||||
EXPOSE 5000
|
||||
CMD ["dotnet", "MauMau-Server.dll"]
|
||||
Reference in New Issue
Block a user