Skip to content

Commit

Permalink
The glibc patch for the Dockerfile was only applied to the builder (v…
Browse files Browse the repository at this point in the history
…ercel#2335)

* Apply glibc patch to the installer stage of both dockerfiles in the with-docker example

* Update the docs with the updated Dockerfile

* Use other dockerfile in docs

* fixup bad lockfile

Co-authored-by: Chris Olszewski <[email protected]>
  • Loading branch information
rafaeltab and chris-olszewski authored Oct 26, 2022
1 parent 78ac7ac commit a2a04ed
Show file tree
Hide file tree
Showing 4 changed files with 176 additions and 4 deletions.
2 changes: 2 additions & 0 deletions docs/pages/repo/docs/handbook/deploying-with-docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ Our detailed [`with-docker` example](https://github.com/vercel/turbo/tree/main/e

```docker
FROM node:alpine AS builder
RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory
WORKDIR /app
Expand All @@ -121,6 +122,7 @@ RUN turbo prune --scope=web --docker
# Add lockfile and package.json's of isolated subworkspace
FROM node:alpine AS installer
RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app
Expand Down
5 changes: 3 additions & 2 deletions examples/with-docker/apps/api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This Dockerfile is copy-pasted into our main docs at /docs/handbook/deploying-with-docker.
# Make sure you update both files!
# The web Dockerfile is copy-pasted into our main docs at /docs/handbook/deploying-with-docker.
# Make sure you update this Dockerfile, the Dockerfile in the web workspace and copy that over to Dockerfile in the docs.

FROM node:alpine AS builder
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
Expand All @@ -13,6 +13,7 @@ RUN turbo prune --scope=api --docker

# Add lockfile and package.json's of isolated subworkspace
FROM node:alpine AS installer
RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app

Expand Down
3 changes: 2 additions & 1 deletion examples/with-docker/apps/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN turbo prune --scope=web --docker

# Add lockfile and package.json's of isolated subworkspace
FROM node:alpine AS installer
RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app

Expand All @@ -38,7 +39,7 @@ USER nextjs
COPY --from=installer /app/apps/web/next.config.js .
COPY --from=installer /app/apps/web/package.json .

# Automatically leverage output traces to reduce image size
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
Expand Down
170 changes: 169 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a2a04ed

Please sign in to comment.