fp/d.bot.dockerfile

21 lines
450 B
Docker

FROM node:20 AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
FROM base AS build
ENV NODE_ENV=production
COPY ./packages/bot /usr/src/app
WORKDIR /usr/src/app
RUN mkdir -p /prod/scout
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm deploy --filter=bot --prod /prod/scout
FROM base AS bot
COPY --from=build /prod/bot /app
WORKDIR /app
ENTRYPOINT ["pnpm"]
CMD ["run", "start"]