fix:dockerfile
This commit is contained in:
@@ -22,10 +22,10 @@ COPY apps/backend/package.json ./apps/backend/
|
|||||||
RUN pnpm config set store-dir /app/.pnpm-store \
|
RUN pnpm config set store-dir /app/.pnpm-store \
|
||||||
&& pnpm config set registry ${NPM_CONFIG_REGISTRY}
|
&& pnpm config set registry ${NPM_CONFIG_REGISTRY}
|
||||||
|
|
||||||
# Prefetch tarballs to the store, then install offline to avoid flaky networks
|
# Prefetch only backend dependencies, then install offline without running scripts
|
||||||
RUN --mount=type=cache,id=pnpm-store,target=/app/.pnpm-store \
|
RUN --mount=type=cache,id=pnpm-store,target=/app/.pnpm-store \
|
||||||
pnpm fetch --filter backend... \
|
pnpm fetch --filter ./apps/backend \
|
||||||
&& pnpm install --filter backend... --offline --frozen-lockfile
|
&& pnpm -C apps/backend install --offline --frozen-lockfile --ignore-scripts
|
||||||
|
|
||||||
FROM deps AS build
|
FROM deps AS build
|
||||||
COPY apps ./apps
|
COPY apps ./apps
|
||||||
@@ -39,7 +39,7 @@ COPY apps/backend/package.json ./apps/backend/
|
|||||||
# Bring over the prefetched store and deploy production deps offline
|
# Bring over the prefetched store and deploy production deps offline
|
||||||
COPY --from=deps /app/.pnpm-store /app/.pnpm-store
|
COPY --from=deps /app/.pnpm-store /app/.pnpm-store
|
||||||
RUN pnpm config set store-dir /app/.pnpm-store \
|
RUN pnpm config set store-dir /app/.pnpm-store \
|
||||||
&& pnpm --offline deploy --filter backend /app/apps/backend
|
&& pnpm --offline deploy --filter ./apps/backend --prod --ignore-scripts /app/apps/backend
|
||||||
COPY --from=build /app/apps/backend/dist ./apps/backend/dist
|
COPY --from=build /app/apps/backend/dist ./apps/backend/dist
|
||||||
WORKDIR /app/apps/backend
|
WORKDIR /app/apps/backend
|
||||||
EXPOSE 4000
|
EXPOSE 4000
|
||||||
|
|||||||
Reference in New Issue
Block a user