Fernando Sánchez
12/26/2022, 5:02 PMJosh
12/26/2022, 5:04 PMColin - Krumware
12/27/2022, 5:36 PMFernando Sánchez
12/28/2022, 11:08 AMturbo module not found . We think that in the runner's phase of the docker, turbo is not available, because on the top of the file, we run the command yarn turbo build --filter="@calcom/web" and it works fine. Then, at the bottom of the docker, when we run the command yarn turbo start --scope="@calcom/web" the command fails saying the turbo Module not found . We don't know which is the problem. This is an URGENT error because we are running out of time. We need this project deployed as soon as possible, so all the help would be appreciated. Moreover, ad if it is neccessary, this effort for helping us to deploy the project would be PAID. Here it is the dockerfile and the complete log.
Log error:
[+] Building 2.9s (17/20)
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 32B 0.1s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 34B 0.0s
=> [internal] load metadata for <http://docker.io/library/node:16|docker.io/library/node:16> 2.8s
=> [auth] library/node:pull token for <http://registry-1.docker.io|registry-1.docker.io> 0.0s
=> [runner 1/10] FROM <http://docker.io/library/node:16@sha256:64e8bcdfdad6718050801a2639f7e6645fdaf85ec37a98cdb61f6a5331217618|docker.io/library/node:16@sha256:64e8bcdfdad6718050801a2639f7e6645fdaf85ec37a98cdb61f6a5331217618> 0.0s
=> [internal] load build context 1.1s
=> => transferring context: 800.72kB 1.1s
=> CACHED [runner 2/10] WORKDIR /calcom 0.0s
=> CACHED [builder 3/7] COPY package.json yarn.lock turbo.json ./ 0.0s
=> CACHED [builder 4/7] COPY apps/web ./apps/web 0.0s
=> CACHED [builder 5/7] COPY packages ./packages 0.0s
=> CACHED [builder 6/7] RUN yarn global add turbo && yarn config set network-timeout 1000000000 -g && turbo prune --scope=@calcom/web --docker && yarn install 0.0s
=> CACHED [builder 7/7] RUN yarn turbo run build --filter=@calcom/web 0.0s
=> CACHED [runner 3/10] RUN apt-get update && apt-get -y install netcat && rm -rf /var/lib/apt/lists/* && npm install --global prisma 0.0s
=> CACHED [runner 4/10] COPY package.json yarn.lock turbo.json ./ 0.0s
=> ERROR [runner 5/10] COPY --from=builder /node_modules ./node_modules 0.0s
=> ERROR [runner 6/10] COPY --from=builder /packages ./packages 0.0s
=> ERROR [runner 7/10] COPY --from=builder /apps/web ./apps/web 0.0s
=> ERROR [runner 8/10] COPY --from=builder /packages/prisma/schema.prisma ./prisma/schema.prisma 0.0s
------
> [runner 5/10] COPY --from=builder /node_modules ./node_modules:
------
------
> [runner 6/10] COPY --from=builder /packages ./packages:
------
------
> [runner 7/10] COPY --from=builder /apps/web ./apps/web:
------
------
> [runner 8/10] COPY --from=builder /packages/prisma/schema.prisma ./prisma/schema.prisma:
------
failed to solve: failed to compute cache key: "/packages/prisma/schema.prisma" not found: not found
Dockerfile:
FROM node:16 as builder
WORKDIR /calcom
ARG NEXT_PUBLIC_LICENSE_CONSENT
ARG CALCOM_TELEMETRY_DISABLED
ARG NEXTAUTH_SECRET=secret
ARG CALENDSO_ENCRYPTION_KEY=secret
ARG MAX_OLD_SPACE_SIZE=4096
ENV NEXT_PUBLIC_WEBAPP_URL=<http://NEXT_PUBLIC_WEBAPP_URL_PLACEHOLDER> \
NEXT_PUBLIC_LICENSE_CONSENT=$NEXT_PUBLIC_LICENSE_CONSENT \
CALCOM_TELEMETRY_DISABLED=$CALCOM_TELEMETRY_DISABLED \
DATABASE_URL=$DATABASE_URL \
NEXTAUTH_SECRET=${NEXTAUTH_SECRET} \
CALENDSO_ENCRYPTION_KEY=${CALENDSO_ENCRYPTION_KEY} \
NODE_OPTIONS=--max-old-space-size=${MAX_OLD_SPACE_SIZE}
COPY package.json yarn.lock turbo.json ./
COPY apps/web ./apps/web
COPY packages ./packages
RUN yarn global add turbo && \
yarn config set network-timeout 1000000000 -g && \
turbo prune --scope=@calcom/web --docker && \
yarn install
RUN yarn turbo run build --filter=@calcom/web
FROM node:16 as runner
WORKDIR /calcom
ARG NEXT_PUBLIC_WEBAPP_URL=<http://localhost:3000>
ENV NODE_ENV production
RUN apt-get update && \
apt-get -y install netcat && \
rm -rf /var/lib/apt/lists/* && \
npm install --global prisma
COPY package.json yarn.lock turbo.json ./
COPY --from=builder /node_modules ./node_modules
COPY --from=builder /packages ./packages
COPY --from=builder /apps/web ./apps/web
COPY --from=builder /packages/prisma/schema.prisma ./prisma/schema.prisma
COPY scripts scripts
# Save value used during this build stage. If NEXT_PUBLIC_WEBAPP_URL and BUILT_NEXT_PUBLIC_WEBAPP_URL differ at
# run-time, then start.sh will find/replace static values again.
ENV NEXT_PUBLIC_WEBAPP_URL=$NEXT_PUBLIC_WEBAPP_URL \
BUILT_NEXT_PUBLIC_WEBAPP_URL=$NEXT_PUBLIC_WEBAPP_URL
RUN scripts/replace-placeholder.sh <http://NEXT_PUBLIC_WEBAPP_URL_PLACEHOLDER> ${NEXT_PUBLIC_WEBAPP_URL}
EXPOSE 3000
CMD ["scripts/start.sh"]
start.sh
#!/bin/sh
set -x
# Replace the statically built BUILT_NEXT_PUBLIC_WEBAPP_URL with run-time NEXT_PUBLIC_WEBAPP_URL
# NOTE: if these values are the same, this will be skipped.
scripts/replace-placeholder.sh "$BUILT_NEXT_PUBLIC_WEBAPP_URL" "$NEXT_PUBLIC_WEBAPP_URL"
#scripts/wait-for-it.sh ${DATABASE_HOST} -- echo "database is up"
npx prisma migrate deploy --schema ./packages/prisma/schema.prisma
npx ts-node --transpile-only /packages/prisma/seed-app-store.ts
yarn startColin - Krumware
12/28/2022, 1:57 PMColin - Krumware
12/28/2022, 1:58 PMColin - Krumware
12/28/2022, 2:01 PM--no-cache to the end of your command. Your log does appear to be failing to copy files from the first stage into the second stage, but I can't tell if something else is happening due to those cached build layers. https://docs.docker.com/engine/reference/commandline/compose_build/Colin - Krumware
12/28/2022, 2:01 PM