another attempt that runs but is stuck in a loop?
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -3,3 +3,6 @@ bin
|
||||
obj
|
||||
Properties
|
||||
appsettings.Local.json
|
||||
.git
|
||||
*.DotSettings.user
|
||||
*.sln
|
||||
@@ -1,15 +0,0 @@
|
||||
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"]
|
||||
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"]
|
||||
@@ -4,7 +4,7 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: final
|
||||
#target: final
|
||||
container_name: 'MauMau-server'
|
||||
restart: always
|
||||
networks:
|
||||
Reference in New Issue
Block a user