Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Feb 21, 2024
1 parent b040fd5 commit 8eb4ea2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
1 change: 0 additions & 1 deletion .github/workflows/backend-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,3 @@ jobs:
token: ${{ secrets.TOKEN_GPR }}
repository: BUTR/BUTR.Site.NexusMods
event-type: deploy-docker-image

27 changes: 13 additions & 14 deletions src/BUTR.Site.NexusMods.Server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS restore
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS restore
ARG TARGETARCH
WORKDIR /build

COPY ["src/BUTR.Site.NexusMods.Server/BUTR.Site.NexusMods.Server.csproj", "src/BUTR.Site.NexusMods.Server/"]
COPY ["src/BUTR.Site.NexusMods.DependencyInjection/BUTR.Site.NexusMods.DependencyInjection.csproj", "src/BUTR.Site.NexusMods.DependencyInjection/"]
COPY ["src/BUTR.Site.NexusMods.Shared/BUTR.Site.NexusMods.Shared.csproj", "src/BUTR.Site.NexusMods.Shared/"]
COPY ["src/BUTR.Site.NexusMods.Server/BUTR.Site.NexusMods.Server.csproj", "src/BUTR.Site.NexusMods.Server/"]
COPY ["src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/BUTR.Site.NexusMods.Server.ValueObjects.Vogen.csproj", "src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/"]
COPY ["src/BUTR.Site.NexusMods.Server.ValueObjects.TVO/BUTR.Site.NexusMods.Server.ValueObjects.TVO.csproj", "src/BUTR.Site.NexusMods.Server.ValueObjects.TVO/"]
COPY ["src/BUTR.Site.NexusMods.DependencyInjection/BUTR.Site.NexusMods.DependencyInjection.csproj", "src/BUTR.Site.NexusMods.DependencyInjection/"]
#COPY ["src/BUTR.Site.NexusMods.Server.ValueObjects.TVO/BUTR.Site.NexusMods.Server.ValueObjects.TVO.csproj", "src/BUTR.Site.NexusMods.Server.ValueObjects.TVO/"]
COPY ["src/nuget.config", "src/"]

RUN dotnet restore "src/BUTR.Site.NexusMods.Server/BUTR.Site.NexusMods.Server.csproj";
RUN dotnet restore "src/BUTR.Site.NexusMods.Server/BUTR.Site.NexusMods.Server.csproj" -a $TARGETARCH;

COPY ["src/BUTR.Site.NexusMods.Server/", "src/BUTR.Site.NexusMods.Server/"]
COPY ["src/BUTR.Site.NexusMods.DependencyInjection/", "src/BUTR.Site.NexusMods.DependencyInjection/"]
COPY ["src/BUTR.Site.NexusMods.Shared/", "src/BUTR.Site.NexusMods.Shared/"]
COPY ["src/BUTR.Site.NexusMods.Server/", "src/BUTR.Site.NexusMods.Server/"]
COPY ["src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/", "src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/"]
COPY ["src/BUTR.Site.NexusMods.Server.ValueObjects.TVO/", "src/BUTR.Site.NexusMods.Server.ValueObjects.TVO/"]
COPY ["src/BUTR.Site.NexusMods.DependencyInjection/", "src/BUTR.Site.NexusMods.DependencyInjection/"]
#COPY ["src/BUTR.Site.NexusMods.Server.ValueObjects.TVO/", "src/BUTR.Site.NexusMods.Server.ValueObjects.TVO/"]

COPY [".git/HEAD", ".git/HEAD"]
COPY [".git/config", ".git/config"]
COPY [".git/refs/heads/", ".git/refs/heads/"]


FROM restore AS publish
ARG TARGETARCH
WORKDIR /build

RUN dotnet publish "src/BUTR.Site.NexusMods.Server/BUTR.Site.NexusMods.Server.csproj" -c Release -o /app/publish;
RUN dotnet publish "src/BUTR.Site.NexusMods.Server/BUTR.Site.NexusMods.Server.csproj" --no-restore -c Release -a $TARGETARCH -o /app/publish;
#RUN dotnet publish "src/BUTR.Site.NexusMods.Server/BUTR.Site.NexusMods.Server.csproj" --no-restore -c Release -r linux-x64 -o /app/publish -p:PublishReadyToRun=true;


FROM base AS final

FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy AS final
WORKDIR /app
RUN apt-get update \
&& apt-get install -y wget \
&& wget https://packages.microsoft.com/config/ubuntu/22.10/packages-microsoft-prod.deb \
Expand Down

0 comments on commit 8eb4ea2

Please sign in to comment.