Skip to content

Commit

Permalink
build: update Dockerfile, endeveit/docker-jq is not available anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
tippfehlr committed Apr 26, 2024
1 parent d67ebc4 commit a834969
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
# https://stackoverflow.com/a/58487433
# To prevent cache invalidation from changes in fields other than dependencies

FROM --platform=$BUILDPLATFORM endeveit/docker-jq AS deps
COPY package.json /tmp
RUN jq '{ dependencies, devDependencies }' < /tmp/package.json > /tmp/deps.json

FROM --platform=$BUILDPLATFORM node:current-alpine AS build
WORKDIR /activity-roles/
RUN apk add python3 make g++
RUN apk add python3 make g++ jq
RUN npm i -g pnpm
COPY tsconfig.json pnpm-lock.yaml .
COPY --from=deps /tmp/deps.json ./package.json
COPY package.json /tmp
RUN jq '{ dependencies, devDependencies }' < /tmp/package.json > ./package.json
RUN pnpm i
COPY src src
RUN ./node_modules/typescript/bin/tsc --outDir out/
Expand All @@ -22,7 +16,7 @@ RUN npm i -g pnpm
COPY img/discord-header.png img/discord-header.png
COPY locales locales
COPY pnpm-lock.yaml .
COPY --from=deps /tmp/deps.json ./package.json
COPY --from=build /activity-roles/package.json ./package.json
RUN pnpm i -P
COPY --from=build /activity-roles/out src

Expand Down

0 comments on commit a834969

Please sign in to comment.