[docker] Update Dockerfile

This commit is contained in:
Laura Hausmann 2024-02-02 00:23:08 +01:00
parent a3c3f6b848
commit 4a1cf59e23
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -16,14 +16,17 @@ RUN yarn --immutable && yarn build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS backend FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS backend
ARG TARGETARCH ARG TARGETARCH
WORKDIR /backend WORKDIR /src
# copy csproj and restore as distinct layers # copy csproj and restore as distinct layers
COPY Iceshrimp.Backend/*.csproj . RUN mkdir Iceshrimp.Backend Iceshrimp.MfmSharp
COPY Iceshrimp.Backend/*.csproj Iceshrimp.Backend
COPY Iceshrimp.MfmSharp/*.csproj Iceshrimp.MfmSharp
WORKDIR /src/Iceshrimp.Backend
RUN dotnet restore -a $TARGETARCH RUN dotnet restore -a $TARGETARCH
# copy backend files # copy files required for backend build
COPY Iceshrimp.Backend/. . COPY ./. /src
# it's faster if we copy this later because we can parallelize it with buildkit, but the build fails if this file doesn't exist # it's faster if we copy this later because we can parallelize it with buildkit, but the build fails if this file doesn't exist
RUN mkdir -p ./wwwroot/.vite/ && touch ./wwwroot/.vite/manifest.json RUN mkdir -p ./wwwroot/.vite/ && touch ./wwwroot/.vite/manifest.json