Fix docker builds

This commit is contained in:
Lea 2023-04-12 22:01:30 +02:00
parent c901c2ba6a
commit 1472f42389
No known key found for this signature in database
GPG key ID: 1BAFFE8347019C42
2 changed files with 25 additions and 0 deletions

View file

@ -1,10 +1,22 @@
FROM node:18 as build
WORKDIR /build/app
COPY bot/package.json bot/yarn.lock bot/.yarnrc.yml ./
COPY bot/.yarn ./.yarn
COPY lib ../lib
COPY revolt.js ../revolt.js
RUN yarn --cwd ../lib --immutable
RUN yarn --cwd ../lib build
# pnpm's --dir doesn't work, so cool!
WORKDIR /build/revolt.js
RUN corepack enable
RUN corepack prepare pnpm@7.14.2 --activate
RUN pnpm install
RUN pnpm run build
WORKDIR /build/app
RUN yarn install --immutable
COPY ./bot .
RUN yarn build
@ -15,5 +27,6 @@ COPY --from=build /build/app/package.json /build/app/yarn.lock /build/app/.yarnr
COPY --from=build /build/app/.yarn ./.yarn
COPY --from=build /build/app/dist ./dist
COPY --from=build /build/lib ../lib
COPY --from=build /build/revolt.js ../revolt.js
RUN yarn install --immutable
CMD ["yarn", "start"]

View file

@ -1,10 +1,21 @@
FROM node:18 as build
WORKDIR /build/app
COPY bridge/package.json bridge/yarn.lock bridge/.yarnrc.yml ./
COPY bridge/.yarn ./.yarn
COPY lib ../lib
COPY revolt.js ../revolt.js
RUN yarn --cwd ../lib --immutable
RUN yarn --cwd ../lib build
WORKDIR /build/revolt.js
RUN corepack enable
RUN corepack prepare pnpm@7.14.2 --activate
RUN pnpm install
RUN pnpm run build
WORKDIR /build/app
RUN yarn install --immutable
COPY ./bridge .
RUN yarn build
@ -15,5 +26,6 @@ COPY --from=build /build/app/package.json /build/app/yarn.lock /build/app/.yarnr
COPY --from=build /build/app/.yarn ./.yarn
COPY --from=build /build/app/dist ./dist
COPY --from=build /build/lib ../lib
COPY --from=build /build/revolt.js ../revolt.js
RUN yarn install --immutable
CMD ["yarn", "start"]