Possible dockerfile fix
This commit is contained in:
20
Dockerfile
20
Dockerfile
@@ -2,20 +2,20 @@
|
||||
WORKDIR /app
|
||||
EXPOSE 5000
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:7.0-bullseye-slim-amd64 AS build
|
||||
WORKDIR /src
|
||||
RUN ls
|
||||
RUN ls ./
|
||||
COPY ["MauMau-Server.csproj", "./"]
|
||||
RUN dotnet restore "MauMau-Server.csproj"
|
||||
ARG TARGETARCH
|
||||
ARG TARGETOS
|
||||
RUN arch=$TARGETARCH \
|
||||
&& if [ "$arch" = "amd64" ]; then arch="x64"; fi \
|
||||
&& echo $TARGETOS-$arch > /tmp/rid
|
||||
COPY *.csproj .
|
||||
RUN dotnet restore -r $(cat /tmp/rid)
|
||||
COPY . .
|
||||
WORKDIR "/src"
|
||||
RUN dotnet build "MauMau-Server.csproj" -c Release -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "MauMau-Server.csproj" -c Release -o /app/publish
|
||||
RUN dotnet publish -c Release -o /app -r $(cat /tmp/rid) --self-contained false --no-restore
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
COPY --from=build /app .
|
||||
ENTRYPOINT ["dotnet", "MauMau-Server.dll"]
|
||||
Reference in New Issue
Block a user