d7002057d7
This PR moves the tldraw.com app into the public repo. ### Change Type - [x] `internal` — Any other changes that don't affect the published package[^2] --------- Co-authored-by: Dan Groshev <git@dgroshev.com> Co-authored-by: alex <alex@dytry.ch>
40 lines
973 B
Docker
40 lines
973 B
Docker
# Install dependencies only when needed
|
|
FROM node:18.12.1-alpine 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 corepack enable
|
|
WORKDIR /app
|
|
COPY . .
|
|
|
|
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn \
|
|
yarn install --immutable
|
|
|
|
ENV NEXT_TELEMETRY_DISABLED 1
|
|
|
|
WORKDIR /app/apps/huppy
|
|
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn build
|
|
|
|
# Production image, copy all the files and run next
|
|
FROM node:18.12.1-alpine AS runner
|
|
|
|
RUN apk update && apk upgrade && \
|
|
apk add --no-cache bash git openssh
|
|
|
|
WORKDIR /app
|
|
|
|
RUN corepack enable
|
|
|
|
ENV NODE_ENV production
|
|
ENV NEXT_TELEMETRY_DISABLED 1
|
|
|
|
RUN addgroup --system --gid 1001 nodejs
|
|
RUN adduser --system --uid 1001 nextjs
|
|
|
|
COPY --from=builder /app ./
|
|
|
|
USER nextjs
|
|
|
|
WORKDIR /app/apps/huppy
|
|
CMD ["yarn", "start"]
|
|
|