/
Dockerfile
37 lines (32 loc) · 1.25 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
FROM --platform=linux/amd64 node:16-alpine3.17 AS base
RUN apk add --no-cache libc6-compat openssl1.1-compat
RUN apk update
RUN npm install -g turbo pnpm
FROM base AS builder
WORKDIR /app
COPY . .
RUN turbo prune --scope=@prisma-editor/web --docker
FROM base AS installer
ARG SKIP_ENV_VALIDATION=true
WORKDIR /app
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
RUN pnpm install
COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json
RUN pnpm web postinstall
RUN pnpm turbo run build --filter=@prisma-editor/web
CMD [ "pnpm","start" ]
# TODO: fix Cannot find module 'next/dist/server/next-server' & remove CMD [ "pnpm","start" ]
# FROM --platform=linux/amd64 node:16-alpine3.17 AS runner
# WORKDIR /app
# RUN addgroup --system --gid 1001 nodejs
# RUN adduser --system --uid 1001 nextjs
# USER nextjs
# COPY --from=installer /app/apps/web/next.config.mjs .
# COPY --from=installer /app/apps/web/package.json .
# 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
# COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public
# CMD node server.js