diff --git a/docs/pages/blog/turbo-0-4-0.mdx b/docs/pages/blog/turbo-0-4-0.mdx index c4b92baeda210..eb1425d90d48d 100644 --- a/docs/pages/blog/turbo-0-4-0.mdx +++ b/docs/pages/blog/turbo-0-4-0.mdx @@ -102,7 +102,7 @@ COPY --from=pruner /app/out/yarn.lock ./yarn.lock RUN yarn install # Copy source code of pruned subworkspace and build -FROM base as builder +FROM base AS builder WORKDIR /app COPY --from=pruner /app/.git ./.git COPY --from=pruner /app/out/full/ . diff --git a/docs/pages/repo/docs/handbook/deploying-with-docker.mdx b/docs/pages/repo/docs/handbook/deploying-with-docker.mdx index fafb0418b53ca..8405868a431e2 100644 --- a/docs/pages/repo/docs/handbook/deploying-with-docker.mdx +++ b/docs/pages/repo/docs/handbook/deploying-with-docker.mdx @@ -114,7 +114,9 @@ Splitting up **dependencies** and **source files** in this way lets us **only ru Our detailed [`with-docker` example](https://github.com/vercel/turbo/tree/main/examples/with-docker) goes into depth on how to utilise `prune` to its full potential. Here's the Dockerfile, copied over for convenience. ```docker -FROM node:alpine AS builder +FROM node:18-alpine AS base + +FROM base AS builder RUN apk add --no-cache libc6-compat RUN apk update # Set working directory @@ -124,7 +126,7 @@ COPY . . RUN turbo prune --scope=web --docker # Add lockfile and package.json's of isolated subworkspace -FROM node:alpine AS installer +FROM base AS installer RUN apk add --no-cache libc6-compat RUN apk update WORKDIR /app @@ -139,7 +141,7 @@ RUN yarn install COPY --from=builder /app/out/full/ . RUN yarn turbo run build --filter=web... -FROM node:alpine AS runner +FROM base AS runner WORKDIR /app # Don't run production as root diff --git a/examples/with-docker/apps/api/Dockerfile b/examples/with-docker/apps/api/Dockerfile index 1b8e878fbba6a..2c8ba9b11bcc3 100644 --- a/examples/with-docker/apps/api/Dockerfile +++ b/examples/with-docker/apps/api/Dockerfile @@ -1,7 +1,9 @@ +FROM node:18-alpine AS base + # 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 +FROM base AS builder # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. RUN apk add --no-cache libc6-compat RUN apk update @@ -12,7 +14,7 @@ COPY . . RUN turbo prune --scope=api --docker # Add lockfile and package.json's of isolated subworkspace -FROM node:alpine AS installer +FROM base AS installer RUN apk add --no-cache libc6-compat RUN apk update WORKDIR /app @@ -36,7 +38,7 @@ COPY turbo.json turbo.json RUN yarn turbo run build --filter=api... -FROM node:alpine AS runner +FROM base AS runner WORKDIR /app # Don't run production as root diff --git a/examples/with-docker/apps/web/Dockerfile b/examples/with-docker/apps/web/Dockerfile index 6f7da763d834e..0d013ab80e4dc 100644 --- a/examples/with-docker/apps/web/Dockerfile +++ b/examples/with-docker/apps/web/Dockerfile @@ -1,7 +1,9 @@ +FROM node:18-alpine AS base + # This Dockerfile is copy-pasted into our main docs at /docs/handbook/deploying-with-docker. # Make sure you update both files! -FROM node:alpine AS builder +FROM base AS builder # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. RUN apk add --no-cache libc6-compat RUN apk update @@ -12,7 +14,7 @@ COPY . . RUN turbo prune --scope=web --docker # Add lockfile and package.json's of isolated subworkspace -FROM node:alpine AS installer +FROM base AS installer RUN apk add --no-cache libc6-compat RUN apk update WORKDIR /app @@ -36,7 +38,7 @@ COPY turbo.json turbo.json RUN yarn turbo run build --filter=web... -FROM node:alpine AS runner +FROM base AS runner WORKDIR /app # Don't run production as root