Replies: 1 comment
-
|
Good catch! The docs could be clearer here. The key insight: Solution 1: Use pnpm deploy --filter=app --prod /path/to/deploy --forceThis ignores Solution 2: Build inside Docker after deploy # Copy source first
COPY . .
# Install deps
RUN pnpm install --frozen-lockfile
# Build (creates dist/)
RUN pnpm --filter=app build
# Deploy (dist now exists and gets copied)
RUN pnpm deploy --filter=app --prod /appSolution 3: Exclude dist from .gitignore during deploy # Temporarily allow dist
echo "!dist" >> .gitignore
pnpm deploy --filter=app --prod /deploy
git checkout .gitignoreBest practice for Docker: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Guide: https://pnpm.io/docker#example-2-build-multiple-docker-images-in-a-monorepo
For the monorepo example specifically, we see dist already exists before we are shown the Dockerfile. No problem, I can assume I can add that in the Dockerfile in a prior step to running
pnpm deploy.What immensely confuses me is the last section at the bottom of the page for
pnpm deploy:Going back to the monorepo example, we see a .gitignore. The output, dist, will obviously be in this. So... won't that example simply... fail?
pnpm deploywill not even copy dist because it is ignored, no?Beta Was this translation helpful? Give feedback.
All reactions