Skip to content

Commit

Permalink
update docs dockerfile to stop using latest pnpm and breaking build, …
Browse files Browse the repository at this point in the history
…switch to corepack enable
  • Loading branch information
matyson committed May 21, 2024
1 parent 4993831 commit c8d46a2
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions apps/docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
# Builder
FROM node:alpine AS builder
RUN apk add --no-cache libc6-compat
RUN apk update
FROM node:18-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable


# ----
# Install dependencies only when needed
FROM base AS deps
# 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
WORKDIR /app
RUN yarn global add turbo
RUN pnpm add --global turbo
COPY . .
RUN turbo prune @deepsirius-ui/docs --docker

# Installer
FROM node:alpine AS installer
RUN apk add --no-cache libc6-compat
RUN apk update

FROM deps AS installer
WORKDIR /app
RUN yarn global add pnpm
RUN yarn global add turbo

COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=builder /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml
RUN pnpm install

COPY --from=builder /app/out/full/ .
COPY --from=deps /app/out/full/ .
COPY turbo.json turbo.json

RUN turbo build --filter=@deepsirius-ui/docs...

# Runner
FROM node:alpine AS runner
FROM base AS runner
WORKDIR /app

RUN addgroup --system --gid 1001 nodejs
Expand Down

0 comments on commit c8d46a2

Please sign in to comment.