-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (30 loc) · 1.22 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# This dockerfile is solely to build locally in vercel's env to cache builds for turbo
FROM amazonlinux:2023 as base
RUN yum install nodejs20 npm -y
# 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 base AS builder
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
# Set working directory
WORKDIR /usr/app
RUN npm i turbo -g
COPY . .
RUN npx turbo prune web --docker
# Add lockfile and package.json's of isolated subworkspace
FROM base AS installer
WORKDIR /usr/app
RUN npm i turbo -g
# First install dependencies (as they change less often)
COPY --from=builder /usr/app/out/json/ .
COPY --from=builder /usr/app/out/package-lock.json ./package-lock.json
RUN npm i
RUN npm run patch
# Build the project and its dependencies
COPY --from=builder /usr/app/out/full/ .
COPY turbo.json turbo.json
# Uncomment and use build args to enable remote caching
ARG TURBO_TEAM
ENV TURBO_TEAM=$TURBO_TEAM
ARG TURBO_TOKEN
ENV TURBO_TOKEN=$TURBO_TOKEN
RUN npx turbo build --filter=web...