diff --git a/apps/api/Dockerfile b/apps/api/Dockerfile index 817f10b..ae3feda 100644 --- a/apps/api/Dockerfile +++ b/apps/api/Dockerfile @@ -5,12 +5,13 @@ LABEL fly_launch_runtime="Node.js" RUN corepack enable WORKDIR /app -FROM base AS prod-deps +# Copy only the package files first COPY package.json pnpm-lock.yaml ./ + +FROM base AS prod-deps RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile FROM base AS build -COPY package.json pnpm-lock.yaml ./ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile COPY . . RUN pnpm run build @@ -26,4 +27,4 @@ COPY --from=build /app /app EXPOSE 8080 ENV PUPPETEER_EXECUTABLE_PATH="/usr/bin/chromium" CMD ["pnpm", "run", "start:production"] -CMD ["pnpm", "run", "worker:production"] \ No newline at end of file +CMD ["pnpm", "run", "worker:production"]