Skip to content

Commit

Permalink
feat(DEV-10495): add multilayer Docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
radist2s committed Jul 5, 2024
1 parent 01bde92 commit c0b0f46
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion SdkDemoWithNextjsAndClerkAuth.PullPreviewDeploy.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ FROM node:20.12.2 as base

WORKDIR /app

COPY . /app
COPY . /tmp/src
RUN find /tmp/src -name 'package.json' -o -name 'yarn.lock' -exec cp --parents {} /app \; && rm -rf /tmp/src

# never mind about '--immutable' for the preview
RUN --mount=type=cache,target=/app/.yarn/cache,id=yarn-cache \
yarn install
Expand All @@ -16,6 +18,9 @@ ARG NEXT_PUBLIC_CLERK_IS_SATELLITE=true
ARG NEXT_PUBLIC_CLERK_DOMAIN
ARG APP_SIGN_IN_URL

COPY --from=base /app .
COPY . .

RUN yarn build --filter='sdk-demo-with-nextjs-and-clerk-auth'

RUN --mount=type=secret,id=clerk_publishable_key \
Expand Down

0 comments on commit c0b0f46

Please sign in to comment.