2024-07-14 05:20:35 +00:00
|
|
|
FROM node:20 as base
|
|
|
|
ENV PNPM_HOME="/pnpm"
|
|
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
|
|
WORKDIR /app
|
|
|
|
RUN corepack enable && corepack prepare pnpm@9.5.0 --activate
|
|
|
|
|
|
|
|
FROM base AS install
|
|
|
|
COPY pnpm-lock.yaml .npmrc package.json .
|
|
|
|
COPY ./packages/types/ ./packages/types/
|
|
|
|
COPY ./packages/storage/ ./packages/storage/
|
|
|
|
COPY ./packages/scout/ ./packages/scout/
|
|
|
|
COPY ./packages/image/ ./packages/image/
|
|
|
|
COPY ./packages/utils/ ./packages/utils/
|
|
|
|
COPY ./packages/temporal-worker/ ./packages/temporal-worker/
|
|
|
|
COPY ./packages/temporal-workflows/ ./packages/temporal-workflows/
|
|
|
|
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=temporal-worker --prod /prod/temporal-worker
|
|
|
|
|
|
|
|
# FROM base as build
|
|
|
|
# RUN mkdir -p /prod/worker
|
|
|
|
# COPY pnpm-workspace.yaml package.json pnpm-lock.yaml .npmrc .
|
|
|
|
# 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 --prefer-offline
|
|
|
|
# COPY ./packages/temporal-workflows/ ./packages/temporal-workflows/
|
|
|
|
# COPY ./packages/temporal-worker/ ./packages/temporal-worker/
|
|
|
|
# RUN ls -la .
|
|
|
|
# RUN ls -la ./packages
|
|
|
|
# RUN ls -la ./packages/temporal-workflows
|
|
|
|
# RUN pnpm -r build
|
|
|
|
# RUN pnpm deploy --filter=temporal-worker --prod /prod/worker
|
|
|
|
|
|
|
|
FROM base as worker
|
|
|
|
COPY --from=build /prod/temporal-worker .
|
2024-07-15 16:07:04 +00:00
|
|
|
RUN ls -la ./
|
2024-07-14 05:20:35 +00:00
|
|
|
ENTRYPOINT ["pnpm", "start"]
|
|
|
|
|