2022-07-16 07:22:58 +00:00
|
|
|
FROM node:18 as build
|
2022-07-12 16:07:17 +00:00
|
|
|
WORKDIR /build/app
|
2023-04-12 20:01:30 +00:00
|
|
|
|
2022-07-12 16:07:17 +00:00
|
|
|
COPY bot/package.json bot/yarn.lock bot/.yarnrc.yml ./
|
|
|
|
COPY bot/.yarn ./.yarn
|
|
|
|
COPY lib ../lib
|
2023-04-12 20:01:30 +00:00
|
|
|
COPY revolt.js ../revolt.js
|
|
|
|
|
2022-07-15 16:03:51 +00:00
|
|
|
RUN yarn --cwd ../lib --immutable
|
2022-07-15 15:57:40 +00:00
|
|
|
RUN yarn --cwd ../lib build
|
2023-04-12 20:01:30 +00:00
|
|
|
|
|
|
|
# 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
|
2022-07-09 05:18:03 +00:00
|
|
|
RUN yarn install --immutable
|
2022-07-12 16:07:17 +00:00
|
|
|
COPY ./bot .
|
2021-10-10 18:11:03 +00:00
|
|
|
RUN yarn build
|
|
|
|
|
2022-07-16 07:22:58 +00:00
|
|
|
FROM node:18 as prod
|
2022-07-12 16:07:17 +00:00
|
|
|
WORKDIR /app/bot
|
|
|
|
COPY --from=build /build/app/package.json /build/app/yarn.lock /build/app/.yarnrc.yml ./
|
|
|
|
COPY --from=build /build/app/.yarn ./.yarn
|
|
|
|
COPY --from=build /build/app/dist ./dist
|
2022-07-16 07:22:58 +00:00
|
|
|
COPY --from=build /build/lib ../lib
|
2023-04-12 20:01:30 +00:00
|
|
|
COPY --from=build /build/revolt.js ../revolt.js
|
2022-07-09 05:18:03 +00:00
|
|
|
RUN yarn install --immutable
|
2021-10-10 18:11:03 +00:00
|
|
|
CMD ["yarn", "start"]
|