2024-08-01 19:16:35 +00:00
|
|
|
FROM node:20 AS base
|
2024-07-12 14:41:34 +00:00
|
|
|
ENV PNPM_HOME="/pnpm"
|
|
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
|
|
WORKDIR /app
|
2024-08-01 19:16:35 +00:00
|
|
|
RUN corepack enable && corepack prepare pnpm@9.6.0 --activate
|
2024-07-12 14:41:34 +00:00
|
|
|
ENTRYPOINT ["pnpm"]
|
|
|
|
|
|
|
|
FROM base AS install
|
|
|
|
COPY pnpm-lock.yaml .npmrc package.json .
|
2024-08-01 19:16:35 +00:00
|
|
|
COPY ./services/bot/ ./services/bot/
|
2024-08-02 22:12:56 +00:00
|
|
|
COPY ./packages/types/ ./packages/types/
|
2024-07-12 14:41:34 +00:00
|
|
|
|
2024-08-01 19:16:35 +00:00
|
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm fetch
|
2024-07-12 14:41:34 +00:00
|
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --recursive --frozen-lockfile --prefer-offline
|
|
|
|
|
|
|
|
|
|
|
|
FROM install AS build
|
|
|
|
RUN pnpm -r build
|
|
|
|
RUN pnpm deploy --filter=bot --prod /prod/bot
|
|
|
|
|
|
|
|
|
2024-08-01 19:16:35 +00:00
|
|
|
FROM install AS dev
|
|
|
|
WORKDIR /app/services/bot
|
2024-07-12 14:41:34 +00:00
|
|
|
CMD ["run", "dev"]
|
|
|
|
|
|
|
|
|
|
|
|
FROM base AS bot
|
|
|
|
COPY --from=build /prod/bot .
|
|
|
|
CMD ["run", "start"]
|
|
|
|
|