Use TARGETPLATFORM for single dockerfile

This commit is contained in:
Adria Navarro 2024-10-30 13:54:47 +01:00
parent 867dccce5a
commit d510cf8b58
1 changed files with 2 additions and 1 deletions

View File

@ -22,7 +22,8 @@ RUN ./scripts/removeWorkspaceDependencies.sh packages/worker/package.json
RUN jq 'del(.scripts.postinstall)' package.json > temp.json && mv temp.json package.json
RUN ./scripts/removeWorkspaceDependencies.sh package.json
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production --frozen-lockfile
ARG TARGETPLATFORM
RUN --mount=type=cache,target=/root/.yarn/${TARGETPLATFORM} YARN_CACHE_FOLDER=/root/.yarn/${TARGETPLATFORM} yarn install --production --frozen-lockfile
# copy the actual code
COPY packages/server/dist packages/server/dist