2024-07-12 14:41:34 +00:00
|
|
|
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/
|
2024-07-14 05:20:35 +00:00
|
|
|
COPY ./packages/temporal-workflows/pnpm-lock.yaml ./packages/temporal-workflows/
|
|
|
|
COPY ./packages/temporal-worker/pnpm-lock.yaml ./packages/temporal-worker/
|
2024-07-12 14:41:34 +00:00
|
|
|
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/
|
2024-07-14 05:20:35 +00:00
|
|
|
COPY ./packages/temporal-workflows/ ./packages/temporal-workflows/
|
|
|
|
COPY ./packages/temporal-worker/ ./packages/temporal-worker/
|
2024-07-12 14:41:34 +00:00
|
|
|
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"]
|
|
|
|
|