This repository was archived by the owner on Oct 29, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 526
Expand file tree
/
Copy pathDockerfile
More file actions
81 lines (63 loc) · 2.59 KB
/
Copy pathDockerfile
File metadata and controls
81 lines (63 loc) · 2.59 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
FROM node:18-alpine AS base
FROM base AS builder
RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory
WORKDIR /app
RUN yarn global add turbo
COPY calcom/. .
RUN turbo prune @calcom/web --docker
# Add lockfile and package.json's of isolated subworkspace
FROM base AS installer
ARG NEXT_PUBLIC_LICENSE_CONSENT
ARG CALCOM_TELEMETRY_DISABLED
ARG DATABASE_URL
ARG NEXTAUTH_SECRET=secret
ARG NEXT_PUBLIC_API_V2_URL
ARG CALENDSO_ENCRYPTION_KEY=secret
ARG MAX_OLD_SPACE_SIZE=8192
ARG NEXT_PUBLIC_WEBAPP_URL
ARG NEXT_PUBLIC_SENTRY_DSN
ENV NEXT_PUBLIC_WEBAPP_URL=$NEXT_PUBLIC_WEBAPP_URL \
NEXT_PUBLIC_LICENSE_CONSENT=$NEXT_PUBLIC_LICENSE_CONSENT \
CALCOM_TELEMETRY_DISABLED=$CALCOM_TELEMETRY_DISABLED \
DATABASE_URL=$DATABASE_URL \
DATABASE_DIRECT_URL=$DATABASE_URL \
NEXTAUTH_SECRET=${NEXTAUTH_SECRET} \
NEXT_PUBLIC_API_V2_URL=${NEXT_PUBLIC_API_V2_URL} \
CALENDSO_ENCRYPTION_KEY=${CALENDSO_ENCRYPTION_KEY} \
NODE_OPTIONS=--max-old-space-size=${MAX_OLD_SPACE_SIZE} \
NEXT_PUBLIC_SENTRY_DSN=${NEXT_PUBLIC_SENTRY_DSN}
RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app
# First install the dependencies (as they change less often)
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/yarn.lock ./yarn.lock
# app-store packages aren't explicitly required but need to be available
COPY calcom/packages ./packages
RUN yarn install
# Build the project
COPY --from=builder /app/out/full/ .
# Disable linting and type checking in the next build
ENV CI=1
RUN yarn turbo run build --filter=@calcom/web...
FROM base AS runner
WORKDIR /app
# Don't run production as root
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs
COPY --from=installer /app/apps/web/next.config.js .
COPY --from=installer /app/apps/web/package.json .
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
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
RUN yarn global add prisma
COPY calcom/packages/prisma/migrations/. ./prisma/migrations
COPY calcom/packages/prisma/schema.prisma ./prisma/schema.prisma
# TODO: Consider adding seeding script here
CMD ["sh", "-c", "$(yarn global bin)/prisma migrate deploy --schema=prisma/schema.prisma && node apps/web/server.js"]