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
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
|
||||||
#WORKDIR /app
|
WORKDIR /app
|
||||||
#
|
EXPOSE 80
|
||||||
#FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
|
EXPOSE 443
|
||||||
#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
|
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
|
||||||
WORKDIR /source
|
WORKDIR /src
|
||||||
|
COPY ["MauMau-Server/MauMau-Server.csproj", "MauMau-Server/"]
|
||||||
# copy csproj and restore as distinct layers
|
RUN dotnet restore "MauMau-Server/MauMau-Server.csproj"
|
||||||
COPY *.csproj .
|
|
||||||
RUN dotnet restore --use-current-runtime
|
|
||||||
|
|
||||||
# copy everything else and build app
|
|
||||||
COPY . .
|
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 build AS publish
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
RUN dotnet publish "MauMau-Server.csproj" -c Release -o /app/publish
|
||||||
COPY --from=build . .
|
|
||||||
EXPOSE 5000
|
FROM base AS final
|
||||||
CMD ["dotnet", "MauMau-Server.dll"]
|
WORKDIR /app
|
||||||
|
COPY --from=publish /app/publish .
|
||||||
|
ENTRYPOINT ["dotnet", "MauMau-Server.dll"]
|
||||||
@@ -4,9 +4,6 @@
|
|||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<RootNamespace>MauMau_Server</RootNamespace>
|
|
||||||
<AssemblyName>MauMau_Server</AssemblyName>
|
|
||||||
<OutputPath>out\</OutputPath>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
Reference in New Issue
Block a user