fp/d.scout.dockerfile

31 lines
1.1 KiB
Docker

FROM node:20 as base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
WORKDIR /app
RUN corepack enable
FROM base as build
WORKDIR /usr/src/app
RUN mkdir -p /usr/src/app/packages/scout && mkdir /usr/src/app/packages/taco && mkdir -p /prod/scout
COPY package.json pnpm-lock.yaml .
COPY ./packages/scout/pnpm-lock.yaml ./packages/scout/
COPY ./packages/taco/pnpm-lock.yaml ./packages/taco/
COPY ./packages/types/pnpm-lock.yaml ./packages/types/
COPY ./packages/temporal-workflows/pnpm-lock.yaml ./packages/temporal-workflows/
COPY ./packages/temporal-worker/pnpm-lock.yaml ./packages/temporal-worker/
RUN pnpm fetch
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --recursive --frozen-lockfile
COPY ./packages/scout/ ./packages/scout/
COPY ./packages/taco/ ./packages/taco/
COPY ./packages/types/ ./packages/types/
COPY ./packages/temporal-workflows/ ./packages/temporal-workflows/
COPY ./packages/temporal-worker/ ./packages/temporal-worker/
RUN pnpm -r build
RUN pnpm deploy --filter=scout --prod /prod/scout
FROM base as scout
COPY --from=build /prod/scout .
RUN ls -la .
ENTRYPOINT ["pnpm", "start"]