Hi <@U04F6205FAR> that was the problem, now I can ...
# docker
f
Hi @Josh that was the problem, now I can go further but then, it thros the following error. => 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
j
sorry, i don’t know about that one
c
Can you provide me with a full log of the build? Feel free to send add it as a snippet and/or send it privately
f
Hi @Colin - Krumware I have just seen your message. Here you are the complete log and the dockerfile. We have discovered in these days that if we remove the --frombuilder of the dockerfile on the COPY lines, we don't have this issue. Unfortunately, It throws us another error.
turbo 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:
Copy code
[+] 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:
Copy code
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
Copy code
#!/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 start
c
the things you're doing to remove lines from the dockerfile aren't actually being helpful
it's a two stage build, and turbo isn't installed in the second stage, that's why the command is not found
Try building again while invalidating the cache, add
--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/
Remind me again, have you tried running the public image yet, instead of building your own?