From 392afd77db88d8b7546a579ec64dacea5eab5068 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Mon, 25 Apr 2022 10:44:37 -0400 Subject: [PATCH 01/20] update submodule path --- .gitmodules | 2 +- calendso => calcom | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename calendso => calcom (100%) diff --git a/.gitmodules b/.gitmodules index fa4de21..0c7610a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "calendso"] - path = calendso + path = calcom url = https://github.com/calcom/cal.com.git branch = main diff --git a/calendso b/calcom similarity index 100% rename from calendso rename to calcom From f65f82ab780cd72cc2bb05e9243ab2bbc07a552c Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Mon, 25 Apr 2022 10:45:11 -0400 Subject: [PATCH 02/20] update gitmodules and add dockerignore --- .dockerignore | 3 +++ .gitmodules | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c9b9f80 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.git +.github +.env.example \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 0c7610a..d2e4d9a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ -[submodule "calendso"] +[submodule "calcom"] path = calcom url = https://github.com/calcom/cal.com.git branch = main From 623ddeb74c42b53fc21516ef80357aaaec241a02 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Mon, 25 Apr 2022 11:01:57 -0400 Subject: [PATCH 03/20] update submodule --- calcom | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calcom b/calcom index 6e82d38..a005791 160000 --- a/calcom +++ b/calcom @@ -1 +1 @@ -Subproject commit 6e82d38249058427fa065c50ceaf4a324aeb1b9b +Subproject commit a0057911c1e2b7753e98b80bce7157764ee39a29 From c0a33233ae5fb7004351cb6265e602f0d9e82baa Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Mon, 25 Apr 2022 17:21:12 -0400 Subject: [PATCH 04/20] update dockerfile, use single stage for now --- Dockerfile | 51 ++++++++++++++------------------------------------- 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1bef144..bec3fc8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,51 +1,28 @@ -FROM node:14 as deps - -WORKDIR /calcom -COPY calendso/package.json calendso/yarn.lock ./ -COPY calendso/apps/web/package.json calendso/apps/web/yarn.lock ./apps/web/ -COPY calendso/packages/prisma/package.json ./packages/prisma/package.json -COPY calendso/packages/lib/package.json ./packages/lib/package.json -COPY calendso/packages/tsconfig/package.json ./packages/tsconfig/package.json -# RUN yarn install --frozen-lockfile -RUN yarn install - FROM node:14 as builder -WORKDIR /calcom ARG BASE_URL ARG NEXT_PUBLIC_APP_URL ARG NEXT_PUBLIC_LICENSE_CONSENT ARG NEXT_PUBLIC_TELEMETRY_KEY -ENV BASE_URL=$BASE_URL \ - NEXT_PUBLIC_APP_URL=$NEXT_PUBLIC_APP_URL \ - NEXT_PUBLIC_LICENSE_CONSENT=$NEXT_PUBLIC_LICENSE_CONSENT \ - NEXT_PUBLIC_TELEMETRY_KEY=$NEXT_PUBLIC_TELEMETRY_KEY -COPY calendso/package.json calendso/yarn.lock calendso/turbo.json ./ -COPY calendso/apps/web ./apps/web -COPY calendso/packages ./packages -COPY --from=deps /calcom/node_modules ./node_modules -RUN yarn build && yarn install --production --ignore-scripts --prefer-offline - -FROM node:14 as runner -WORKDIR /calcom -ENV NODE_ENV production RUN apt-get update && \ apt-get -y install netcat && \ rm -rf /var/lib/apt/lists/* && \ npm install --global prisma -COPY calendso/package.json calendso/yarn.lock calendso/turbo.json ./ -COPY --from=builder /calcom/node_modules ./node_modules -COPY --from=builder /calcom/packages ./packages -COPY --from=builder /calcom/apps/web/node_modules ./apps/web/node_modules -COPY --from=builder /calcom/apps/web/scripts ./apps/web/scripts -COPY --from=builder /calcom/apps/web/next.config.js ./apps/web/next.config.js -COPY --from=builder /calcom/apps/web/next-i18next.config.js ./apps/web/next-i18next.config.js -COPY --from=builder /calcom/apps/web/public ./apps/web/public -COPY --from=builder /calcom/apps/web/.next ./apps/web/.next -COPY --from=builder /calcom/apps/web/package.json ./apps/web/package.json -COPY scripts scripts +COPY calcom /calcom +WORKDIR calcom +RUN yarn install --frozen-lockfile +WORKDIR /calcom/apps/web + +ENV BASE_URL=$BASE_URL \ + NEXT_PUBLIC_APP_URL=$NEXT_PUBLIC_APP_URL \ + NEXT_PUBLIC_LICENSE_CONSENT=$NEXT_PUBLIC_LICENSE_CONSENT \ + NEXT_PUBLIC_TELEMETRY_KEY=$NEXT_PUBLIC_TELEMETRY_KEY + +COPY .env .env + +RUN yarn build EXPOSE 3000 -CMD ["/calcom/scripts/start.sh"] +ENTRYPOINT ["scripts/start.sh"] From fbfa063d9eeee4b398a74071768ffbea39f6ab14 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Mon, 25 Apr 2022 17:23:33 -0400 Subject: [PATCH 05/20] use local path instead of absolute root --- scripts/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/start.sh b/scripts/start.sh index 822d1c0..ca739de 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -1,6 +1,6 @@ #!/bin/sh set -x -/calcom/scripts/wait-for-it.sh ${DATABASE_HOST} -- echo "database is up" +scripts/wait-for-it.sh ${DATABASE_HOST} -- echo "database is up" npx prisma migrate deploy --schema /calcom/packages/prisma/schema.prisma yarn start From fb99616960ca4a96d9113f5b4323245784f8f764 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Mon, 25 Apr 2022 17:26:37 -0400 Subject: [PATCH 06/20] remove built-in submodule checkout to prevent recursive checkout --- .github/workflows/docker-build-test.yml | 67 +++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/docker-build-test.yml diff --git a/.github/workflows/docker-build-test.yml b/.github/workflows/docker-build-test.yml new file mode 100644 index 0000000..4c63c01 --- /dev/null +++ b/.github/workflows/docker-build-test.yml @@ -0,0 +1,67 @@ +# This is a basic workflow to help you get started with Actions + +name: Test docker build + +# Controls when the workflow will run +on: + push: + branches: [rework] + # Allow running workflow manually from the Actions tab + workflow_dispatch: + +# Leaving in example for releases. Initially we simply push to 'latest' +# on: + # release: + # types: [ created ] + + # # Allows you to run this workflow manually from the Actions tab + # workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: checkout + uses: actions/checkout@v2 + + - name: Git submodule update + run: | + git submodule update --init + + - name: Docker Login + # You may pin to the exact commit or the version. + # uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + uses: docker/login-action@v1.10.0 + with: + # Username used to log against the Docker registry + username: ${{ secrets.DOCKER_HUB_USERNAME }} + # Password or personal access token used to log against the Docker registry + password: ${{ secrets.DOCKER_HUB_TOKEN }} + # Log out from the Docker registry at the end of a job + logout: true # optional, default is true + + - name: Set up Docker builder + id: buildx + uses: docker/setup-buildx-action@v1.6.0 + + - name: Build and push image + id: docker_build + uses: docker/build-push-action@v2 + with: + context: ./ + file: ./Dockerfile + push: true + # The test image is /docker and is private. final image will be /calendso and public + tags: docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/calendso:latest + build-args: | + BASE_URL=http://localhost:3000 + NEXT_PUBLIC_APP_URL=http://localhost:3000 + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} From 29f1c5704a7ed8abdf7dbd30a1429af9f05e3afe Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Mon, 25 Apr 2022 17:54:12 -0400 Subject: [PATCH 07/20] remove env file copy --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index bec3fc8..2b3659a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,8 +20,6 @@ ENV BASE_URL=$BASE_URL \ NEXT_PUBLIC_LICENSE_CONSENT=$NEXT_PUBLIC_LICENSE_CONSENT \ NEXT_PUBLIC_TELEMETRY_KEY=$NEXT_PUBLIC_TELEMETRY_KEY -COPY .env .env - RUN yarn build EXPOSE 3000 From 5259bc3fafe26d5177785ae9c72e2fe508b012e0 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Mon, 25 Apr 2022 18:04:59 -0400 Subject: [PATCH 08/20] update readme --- README.md | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index fd1ba26..7bca4ce 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,9 @@ For Production, for the time being, please checkout the repository and build/pus ## Requirements -Make sure you have `docker` & `docker-compose` installed on the server / system. +Make sure you have `docker` & `docker compose` installed on the server / system. + +Note: `docker compose` without the hyphen is now the primary method of using docker-compose, per the Docker documentation. ## Getting Started @@ -40,45 +42,46 @@ Make sure you have `docker` & `docker-compose` installed on the server / system. cd calendso-docker ``` -3. Rename `.env.example` to `.env` and update `.env` if needed. - -4. Build and start calendso +3. Update the calcom submodule ```bash - docker-compose up --build + git submodule update --remote --init ``` -5. Start prisma studio +4. Rename `.env.example` to `.env` and then update `.env` + +5. Build and start calendso ```bash - docker-compose exec calendso npx prisma studio + docker compose up --build ``` -6. Open a browser to [http://localhost:5555](http://localhost:5555) to look at or modify the database content. +6. (First Run) Open a browser to [http://localhost:5555](http://localhost:5555) to look at or modify the database content. -7. Click on the `User` model to add a new user record. + a. Click on the `User` model to add a new user record. -8. Fill out the fields (remembering to encrypt your password with [BCrypt](https://bcrypt-generator.com/)) and click `Save 1 Record` to create your first user. + b. Fill out the fields (remembering to encrypt your password with [BCrypt](https://bcrypt-generator.com/)) and click `Save 1 Record` to create your first user. -9. Open a browser to [http://localhost:3000](http://localhost:3000) and login with your just created, first user. +7. Open a browser to [http://localhost:3000](http://localhost:3000) and login with your just created, first user. +## Configuration + +### Build-time variables + +placeholder + +### Run-time variables + +placeholder ## Git Submodules This repository uses a git submodule. -If you cloned the repository without using `--recursive`, then you can initialize and clone the submodule with the following steps. +To update the calcom submodule, use the following command: -1. Init the submodule - - ```bash - git submodule init - ``` - -2. Update the submodule - - ```bash - git submodule update --remote - ``` +```bash +git submodule update --remote --init +``` For more advanced usage, please refer to the git documentation: [https://git-scm.com/book/en/v2/Git-Tools-Submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) From fb8d9248f7dc9f2574aab594cfd578a2b6e8afc2 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Mon, 25 Apr 2022 18:10:21 -0400 Subject: [PATCH 09/20] add build-time variable list --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7bca4ce..d8fd860 100644 --- a/README.md +++ b/README.md @@ -68,11 +68,17 @@ Note: `docker compose` without the hyphen is now the primary method of using doc ### Build-time variables -placeholder +These variables must be provided at the time of the docker build, and can be provided by updating the .env file. Changing these is not required for evaluation, but may be required for running in producion. + +* BASE_URL +* NEXT_PUBLIC_APP_URL +* NEXT_PUBLIC_LICENSE_CONSENT +* NEXT_PUBLIC_TELEMETRY_KEY ### Run-time variables placeholder + ## Git Submodules This repository uses a git submodule. From 8b14ee6ffd59124340fe98b78cc91a0acdd40685 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Tue, 26 Apr 2022 15:58:52 -0400 Subject: [PATCH 10/20] update required env variables --- .env.example | 10 +++---- Dockerfile | 83 ++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 75 insertions(+), 18 deletions(-) diff --git a/.env.example b/.env.example index 46eda2a..f75f1a6 100644 --- a/.env.example +++ b/.env.example @@ -8,8 +8,11 @@ NEXT_PUBLIC_LICENSE_CONSENT= LICENSE= -BASE_URL=http://localhost:3000 -NEXT_PUBLIC_APP_URL=http://localhost:3000 +NEXT_PUBLIC_WEBAPP_URL=http://localhost:3000 + +# It is highly recommended that the NEXTAUTH_SECRET must be overridden and very unique +# Use `openssl rand -base64 32` to generate a key +NEXTAUTH_SECRET=secret POSTGRES_USER=unicorn_user POSTGRES_PASSWORD=magical_password @@ -42,7 +45,4 @@ EMAIL_SERVER_PASSWORD=email_password # Encryption key that will be used to encrypt CalDAV credentials, choose a random string, for example with `dd if=/dev/urandom bs=1K count=1 | md5sum` CALENDSO_ENCRYPTION_KEY= -# It is highly recommended that the JWT secret must be overridden and very unique -JWT_SECRET=secret - NODE_ENV=production diff --git a/Dockerfile b/Dockerfile index 2b3659a..2c63469 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,83 @@ +FROM node:14 as deps + +WORKDIR /calcom + +# Copy rootand all workspace package.json files +COPY calendso/package.json calendso/yarn.lock calendso/turbo.json ./ +COPY calendso/apps/web/package.json calendso/apps/web/yarn.lock ./apps/web/ +COPY calendso/packages/ui/package.json ./packages/ui/package.json +COPY calendso/packages/types/package.json ./packages/types/package.json +COPY calendso/packages/core/package.json ./packages/core/package.json +COPY calendso/packages/config/package.json ./packages/config/package.json +COPY calendso/packages/ee/package.json ./packages/ee/package.json +COPY calendso/packages/tsconfig/package.json ./packages/tsconfig/package.json +COPY calendso/packages/prisma/package.json ./packages/prisma/package.json +COPY calendso/packages/app-store/googlevideo/package.json ./packages/app-store/googlevideo/package.json +COPY calendso/packages/app-store/caldavcalendar/package.json ./packages/app-store/caldavcalendar/package.json +COPY calendso/packages/app-store/zoomvideo/package.json ./packages/app-store/zoomvideo/package.json +COPY calendso/packages/app-store/huddle01video/package.json ./packages/app-store/huddle01video/package.json +COPY calendso/packages/app-store/jitsivideo/package.json ./packages/app-store/jitsivideo/package.json +COPY calendso/packages/app-store/stripepayment/package.json ./packages/app-store/stripepayment/package.json +COPY calendso/packages/app-store/office365video/package.json ./packages/app-store/office365video/package.json +COPY calendso/packages/app-store/office365calendar/package.json ./packages/app-store/office365calendar/package.json +COPY calendso/packages/app-store/slackmessaging/package.json ./packages/app-store/slackmessaging/package.json +COPY calendso/packages/app-store/tandemvideo/package.json ./packages/app-store/tandemvideo/package.json +COPY calendso/packages/app-store/wipemycalother/package.json ./packages/app-store/wipemycalother/package.json +COPY calendso/packages/app-store/package.json ./packages/app-store/package.json +COPY calendso/packages/app-store/_example/package.json ./packages/app-store/_example/package.json +COPY calendso/packages/app-store/googlecalendar/package.json ./packages/app-store/googlecalendar/package.json +COPY calendso/packages/app-store/dailyvideo/package.json ./packages/app-store/dailyvideo/package.json +COPY calendso/packages/app-store/applecalendar/package.json ./packages/app-store/applecalendar/package.json +COPY calendso/packages/app-store/hubspotothercalendar/package.json ./packages/app-store/hubspotothercalendar/package.json +COPY calendso/packages/lib/package.json ./packages/lib/package.json +COPY calendso/packages/embeds/embed-snippet/package.json ./packages/embeds/embed-snippet/package.json +COPY calendso/packages/embeds/embed-react/package.json ./packages/embeds/embed-react/package.json +COPY calendso/packages/embeds/embed-core/package.json ./packages/embeds/embed-core/package.json +COPY calendso/packages/stripe/package.json ./packages/stripe/package.json + +# Prisma schema is required by a post-install script +COPY calendso/packages/prisma/schema.prisma ./packages/prisma/schema.prisma + +# Install dependencies +RUN yarn install --frozen-lockfile + FROM node:14 as builder +WORKDIR /calcom ARG BASE_URL ARG NEXT_PUBLIC_APP_URL ARG NEXT_PUBLIC_LICENSE_CONSENT ARG NEXT_PUBLIC_TELEMETRY_KEY - -RUN apt-get update && \ - apt-get -y install netcat && \ - rm -rf /var/lib/apt/lists/* && \ - npm install --global prisma - -COPY calcom /calcom -WORKDIR calcom -RUN yarn install --frozen-lockfile -WORKDIR /calcom/apps/web - ENV BASE_URL=$BASE_URL \ NEXT_PUBLIC_APP_URL=$NEXT_PUBLIC_APP_URL \ NEXT_PUBLIC_LICENSE_CONSENT=$NEXT_PUBLIC_LICENSE_CONSENT \ NEXT_PUBLIC_TELEMETRY_KEY=$NEXT_PUBLIC_TELEMETRY_KEY -RUN yarn build +COPY calendso/package.json calendso/yarn.lock calendso/turbo.json ./ +COPY calendso/apps/web ./apps/web +COPY calendso/packages ./packages +COPY --from=deps /calcom/node_modules ./node_modules +RUN yarn build && yarn install --ignore-scripts --prefer-offline + +FROM node:14 as runner +WORKDIR /calcom +ENV NODE_ENV production +RUN apt-get update && \ + apt-get -y install netcat && \ + rm -rf /var/lib/apt/lists/* && \ + npm install --global prisma + +COPY calendso/package.json calendso/yarn.lock calendso/turbo.json ./ +COPY --from=builder /calcom/node_modules ./node_modules +COPY --from=builder /calcom/packages ./packages +COPY --from=builder /calcom/apps/web/node_modules ./apps/web/node_modules +COPY --from=builder /calcom/apps/web/scripts ./apps/web/scripts +COPY --from=builder /calcom/apps/web/next.config.js ./apps/web/next.config.js +COPY --from=builder /calcom/apps/web/next-i18next.config.js ./apps/web/next-i18next.config.js +COPY --from=builder /calcom/apps/web/public ./apps/web/public +COPY --from=builder /calcom/apps/web/.next ./apps/web/.next +COPY --from=builder /calcom/apps/web/package.json ./apps/web/package.json +COPY scripts scripts EXPOSE 3000 -ENTRYPOINT ["scripts/start.sh"] +CMD ["/calcom/scripts/start.sh"] From 139f8f4f0e3dff487b717f1900fb8b1f77c8e7ce Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Tue, 26 Apr 2022 15:59:38 -0400 Subject: [PATCH 11/20] remove deprecated url variables --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d8fd860..3bd3139 100644 --- a/README.md +++ b/README.md @@ -68,10 +68,9 @@ Note: `docker compose` without the hyphen is now the primary method of using doc ### Build-time variables -These variables must be provided at the time of the docker build, and can be provided by updating the .env file. Changing these is not required for evaluation, but may be required for running in producion. +These variables must be provided at the time of the docker build, and can be provided by updating the .env file. Changing these is not required for evaluation, but may be required for running in production. Currently, if you require changes to these variables, you must follow the instructions to build and publish your own image. -* BASE_URL -* NEXT_PUBLIC_APP_URL +* NEXT_PUBLIC_WEBAPP_URL * NEXT_PUBLIC_LICENSE_CONSENT * NEXT_PUBLIC_TELEMETRY_KEY From a29e34249273d9ca5348e1911b256504535d0c59 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Tue, 26 Apr 2022 16:01:13 -0400 Subject: [PATCH 12/20] remove repetitive install step and use node_modules from deps --- Dockerfile | 78 +++++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2c63469..21f9792 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,40 +3,40 @@ FROM node:14 as deps WORKDIR /calcom # Copy rootand all workspace package.json files -COPY calendso/package.json calendso/yarn.lock calendso/turbo.json ./ -COPY calendso/apps/web/package.json calendso/apps/web/yarn.lock ./apps/web/ -COPY calendso/packages/ui/package.json ./packages/ui/package.json -COPY calendso/packages/types/package.json ./packages/types/package.json -COPY calendso/packages/core/package.json ./packages/core/package.json -COPY calendso/packages/config/package.json ./packages/config/package.json -COPY calendso/packages/ee/package.json ./packages/ee/package.json -COPY calendso/packages/tsconfig/package.json ./packages/tsconfig/package.json -COPY calendso/packages/prisma/package.json ./packages/prisma/package.json -COPY calendso/packages/app-store/googlevideo/package.json ./packages/app-store/googlevideo/package.json -COPY calendso/packages/app-store/caldavcalendar/package.json ./packages/app-store/caldavcalendar/package.json -COPY calendso/packages/app-store/zoomvideo/package.json ./packages/app-store/zoomvideo/package.json -COPY calendso/packages/app-store/huddle01video/package.json ./packages/app-store/huddle01video/package.json -COPY calendso/packages/app-store/jitsivideo/package.json ./packages/app-store/jitsivideo/package.json -COPY calendso/packages/app-store/stripepayment/package.json ./packages/app-store/stripepayment/package.json -COPY calendso/packages/app-store/office365video/package.json ./packages/app-store/office365video/package.json -COPY calendso/packages/app-store/office365calendar/package.json ./packages/app-store/office365calendar/package.json -COPY calendso/packages/app-store/slackmessaging/package.json ./packages/app-store/slackmessaging/package.json -COPY calendso/packages/app-store/tandemvideo/package.json ./packages/app-store/tandemvideo/package.json -COPY calendso/packages/app-store/wipemycalother/package.json ./packages/app-store/wipemycalother/package.json -COPY calendso/packages/app-store/package.json ./packages/app-store/package.json -COPY calendso/packages/app-store/_example/package.json ./packages/app-store/_example/package.json -COPY calendso/packages/app-store/googlecalendar/package.json ./packages/app-store/googlecalendar/package.json -COPY calendso/packages/app-store/dailyvideo/package.json ./packages/app-store/dailyvideo/package.json -COPY calendso/packages/app-store/applecalendar/package.json ./packages/app-store/applecalendar/package.json -COPY calendso/packages/app-store/hubspotothercalendar/package.json ./packages/app-store/hubspotothercalendar/package.json -COPY calendso/packages/lib/package.json ./packages/lib/package.json -COPY calendso/packages/embeds/embed-snippet/package.json ./packages/embeds/embed-snippet/package.json -COPY calendso/packages/embeds/embed-react/package.json ./packages/embeds/embed-react/package.json -COPY calendso/packages/embeds/embed-core/package.json ./packages/embeds/embed-core/package.json -COPY calendso/packages/stripe/package.json ./packages/stripe/package.json +COPY calcom/package.json calcom/yarn.lock calcom/turbo.json ./ +COPY calcom/apps/web/package.json calcom/apps/web/yarn.lock ./apps/web/ +COPY calcom/packages/ui/package.json ./packages/ui/package.json +COPY calcom/packages/types/package.json ./packages/types/package.json +COPY calcom/packages/core/package.json ./packages/core/package.json +COPY calcom/packages/config/package.json ./packages/config/package.json +COPY calcom/packages/ee/package.json ./packages/ee/package.json +COPY calcom/packages/tsconfig/package.json ./packages/tsconfig/package.json +COPY calcom/packages/prisma/package.json ./packages/prisma/package.json +COPY calcom/packages/app-store/googlevideo/package.json ./packages/app-store/googlevideo/package.json +COPY calcom/packages/app-store/caldavcalendar/package.json ./packages/app-store/caldavcalendar/package.json +COPY calcom/packages/app-store/zoomvideo/package.json ./packages/app-store/zoomvideo/package.json +COPY calcom/packages/app-store/huddle01video/package.json ./packages/app-store/huddle01video/package.json +COPY calcom/packages/app-store/jitsivideo/package.json ./packages/app-store/jitsivideo/package.json +COPY calcom/packages/app-store/stripepayment/package.json ./packages/app-store/stripepayment/package.json +COPY calcom/packages/app-store/office365video/package.json ./packages/app-store/office365video/package.json +COPY calcom/packages/app-store/office365calendar/package.json ./packages/app-store/office365calendar/package.json +COPY calcom/packages/app-store/slackmessaging/package.json ./packages/app-store/slackmessaging/package.json +COPY calcom/packages/app-store/tandemvideo/package.json ./packages/app-store/tandemvideo/package.json +COPY calcom/packages/app-store/wipemycalother/package.json ./packages/app-store/wipemycalother/package.json +COPY calcom/packages/app-store/package.json ./packages/app-store/package.json +COPY calcom/packages/app-store/_example/package.json ./packages/app-store/_example/package.json +COPY calcom/packages/app-store/googlecalendar/package.json ./packages/app-store/googlecalendar/package.json +COPY calcom/packages/app-store/dailyvideo/package.json ./packages/app-store/dailyvideo/package.json +COPY calcom/packages/app-store/applecalendar/package.json ./packages/app-store/applecalendar/package.json +COPY calcom/packages/app-store/hubspotothercalendar/package.json ./packages/app-store/hubspotothercalendar/package.json +COPY calcom/packages/lib/package.json ./packages/lib/package.json +COPY calcom/packages/embeds/embed-snippet/package.json ./packages/embeds/embed-snippet/package.json +COPY calcom/packages/embeds/embed-react/package.json ./packages/embeds/embed-react/package.json +COPY calcom/packages/embeds/embed-core/package.json ./packages/embeds/embed-core/package.json +COPY calcom/packages/stripe/package.json ./packages/stripe/package.json # Prisma schema is required by a post-install script -COPY calendso/packages/prisma/schema.prisma ./packages/prisma/schema.prisma +COPY calcom/packages/prisma/schema.prisma ./packages/prisma/schema.prisma # Install dependencies RUN yarn install --frozen-lockfile @@ -53,11 +53,11 @@ ENV BASE_URL=$BASE_URL \ NEXT_PUBLIC_LICENSE_CONSENT=$NEXT_PUBLIC_LICENSE_CONSENT \ NEXT_PUBLIC_TELEMETRY_KEY=$NEXT_PUBLIC_TELEMETRY_KEY -COPY calendso/package.json calendso/yarn.lock calendso/turbo.json ./ -COPY calendso/apps/web ./apps/web -COPY calendso/packages ./packages +COPY calcom/package.json calcom/yarn.lock calcom/turbo.json ./ +COPY calcom/apps/web ./apps/web +COPY calcom/packages ./packages COPY --from=deps /calcom/node_modules ./node_modules -RUN yarn build && yarn install --ignore-scripts --prefer-offline +RUN yarn build FROM node:14 as runner WORKDIR /calcom @@ -67,10 +67,10 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* && \ npm install --global prisma -COPY calendso/package.json calendso/yarn.lock calendso/turbo.json ./ -COPY --from=builder /calcom/node_modules ./node_modules +COPY calcom/package.json calcom/yarn.lock calcom/turbo.json ./ +COPY --from=deps /calcom/node_modules ./node_modules COPY --from=builder /calcom/packages ./packages -COPY --from=builder /calcom/apps/web/node_modules ./apps/web/node_modules +COPY --from=deps /calcom/apps/web/node_modules ./apps/web/node_modules COPY --from=builder /calcom/apps/web/scripts ./apps/web/scripts COPY --from=builder /calcom/apps/web/next.config.js ./apps/web/next.config.js COPY --from=builder /calcom/apps/web/next-i18next.config.js ./apps/web/next-i18next.config.js From f85a68515e32bed32a4a18fa422fed042813aaae Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Tue, 26 Apr 2022 16:56:33 -0400 Subject: [PATCH 13/20] update dockerfile with updated env variables --- Dockerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 21f9792..9647923 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,11 +44,15 @@ RUN yarn install --frozen-lockfile FROM node:14 as builder WORKDIR /calcom -ARG BASE_URL -ARG NEXT_PUBLIC_APP_URL +ARG NEXT_PUBLIC_WEBAPP_URL ARG NEXT_PUBLIC_LICENSE_CONSENT ARG NEXT_PUBLIC_TELEMETRY_KEY -ENV BASE_URL=$BASE_URL \ +# DEPRECATED +ARG BASE_URL +ARG NEXT_PUBLIC_APP_URL + +ENV NEXT_PUBLIC_WEBAPP_URL=$NEXT_PUBLIC_WEBAPP_URL \ + BASE_URL=$BASE_URL \ NEXT_PUBLIC_APP_URL=$NEXT_PUBLIC_APP_URL \ NEXT_PUBLIC_LICENSE_CONSENT=$NEXT_PUBLIC_LICENSE_CONSENT \ NEXT_PUBLIC_TELEMETRY_KEY=$NEXT_PUBLIC_TELEMETRY_KEY @@ -77,6 +81,7 @@ COPY --from=builder /calcom/apps/web/next-i18next.config.js ./apps/web/next-i18n COPY --from=builder /calcom/apps/web/public ./apps/web/public COPY --from=builder /calcom/apps/web/.next ./apps/web/.next COPY --from=builder /calcom/apps/web/package.json ./apps/web/package.json +COPY --from=builder calcom/packages/prisma/schema.prisma ./prisma/schema.prisma COPY scripts scripts EXPOSE 3000 From 24730e219375df1c2deafb322f1b2748a21dfbee Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Tue, 26 Apr 2022 16:57:44 -0400 Subject: [PATCH 14/20] add important runtime variables --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3bd3139..d26403e 100644 --- a/README.md +++ b/README.md @@ -74,9 +74,9 @@ These variables must be provided at the time of the docker build, and can be pro * NEXT_PUBLIC_LICENSE_CONSENT * NEXT_PUBLIC_TELEMETRY_KEY -### Run-time variables +### Important Run-time variables -placeholder +* NEXTAUTH_SECRET ## Git Submodules From 7ff182f0eda2a9f77f30e3af0f023764b4c650ba Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Tue, 26 Apr 2022 16:58:50 -0400 Subject: [PATCH 15/20] replace baseurl and app_url with new next_public_webapp_url variable --- docker-compose.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 27d9421..e4a6a7d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -18,13 +18,12 @@ services: networks: - stack - calendso: + calcom: build: context: . dockerfile: Dockerfile args: - - BASE_URL=${BASE_URL} - - NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL} + - NEXT_PUBLIC_WEBAPP_URL=${NEXT_PUBLIC_WEBAPP_URL} - NEXT_PUBLIC_LICENSE_CONSENT=${NEXT_PUBLIC_LICENSE_CONSENT} - NEXT_PUBLIC_TELEMETRY_KEY=${NEXT_PUBLIC_TELEMETRY_KEY} restart: always From da59afd476ba42440d49e1a82f53a47022976265 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Tue, 26 Apr 2022 17:07:32 -0400 Subject: [PATCH 16/20] add deprecation notice for baseurl --- .env.example | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.env.example b/.env.example index f75f1a6..67138c7 100644 --- a/.env.example +++ b/.env.example @@ -8,6 +8,10 @@ NEXT_PUBLIC_LICENSE_CONSENT= LICENSE= +# BASE_URL and NEXT_PUBLIC_APP_URL are both deprecated. Both are replaced with one variable, NEXT_PUBLIC_WEBAPP_URL +# BASE_URL=http://localhost:3000 +# NEXT_PUBLIC_APP_URL=http://localhost:3000 + NEXT_PUBLIC_WEBAPP_URL=http://localhost:3000 # It is highly recommended that the NEXTAUTH_SECRET must be overridden and very unique From ec19812e7713ae653f63a2a24228276e30933857 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Tue, 26 Apr 2022 17:17:25 -0400 Subject: [PATCH 17/20] update readme calcom references --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c8bdfcd..c4ef2ec 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,24 @@ # Docker +NOTE: DockerHub organization has not yet been renamed. + This image can be found on DockerHub at [https://hub.docker.com/r/calendso/calendso](https://hub.docker.com/r/calendso/calendso) -The Docker configuration for Calendso is an effort powered by people within the community. Cal.com, Inc. does not provide official support for Docker, but we will accept fixes and documentation. Use at your own risk. +The Docker configuration for Cal.com is an effort powered by people within the community. Cal.com, Inc. does not yet provide official support for Docker, but we will accept fixes and documentation at this time. Use at your own risk. ## Important Notes -This Docker Image is managed by the Calendso Community. Support for this image can be found via the repository, located at [https://github.com/calendso/docker](https://github.com/calcom/docker) +This Docker Image is managed by the Cal.com Community. Support for this image can be found via the repository, located at [https://github.com/calcom/docker](https://github.com/calcom/docker) Currently, this image is intended for local development/evaluation use only, as there are specific requirements for providing environmental variables at build-time in order to specify a non-localhost BASE_URL. (this is due to the nature of the static site compilation, which embeds the variable values). The ability to update these variables at runtime is in-progress and will be available in the future. @@ -30,16 +32,16 @@ Note: `docker compose` without the hyphen is now the primary method of using doc ## Getting Started -1. Clone calendso-docker +1. Clone calcom-docker ```bash - git clone --recursive https://github.com/calendso/docker.git calendso-docker + git clone --recursive https://github.com/calcom/docker.git calcom-docker ``` 2. Change into the directory ```bash - cd calendso-docker + cd calcom-docker ``` 3. Update the calcom submodule @@ -50,7 +52,7 @@ Note: `docker compose` without the hyphen is now the primary method of using doc 4. Rename `.env.example` to `.env` and then update `.env` -5. Build and start calendso +5. Build and start Cal.com via docker compose ```bash docker compose up --build From 73640fe382fce398c2e1758a88dbe8233460179c Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Tue, 26 Apr 2022 17:18:59 -0400 Subject: [PATCH 18/20] remove test workflow --- .github/workflows/docker-build-test.yml | 67 ------------------------- 1 file changed, 67 deletions(-) delete mode 100644 .github/workflows/docker-build-test.yml diff --git a/.github/workflows/docker-build-test.yml b/.github/workflows/docker-build-test.yml deleted file mode 100644 index 4c63c01..0000000 --- a/.github/workflows/docker-build-test.yml +++ /dev/null @@ -1,67 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Test docker build - -# Controls when the workflow will run -on: - push: - branches: [rework] - # Allow running workflow manually from the Actions tab - workflow_dispatch: - -# Leaving in example for releases. Initially we simply push to 'latest' -# on: - # release: - # types: [ created ] - - # # Allows you to run this workflow manually from the Actions tab - # workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: checkout - uses: actions/checkout@v2 - - - name: Git submodule update - run: | - git submodule update --init - - - name: Docker Login - # You may pin to the exact commit or the version. - # uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - uses: docker/login-action@v1.10.0 - with: - # Username used to log against the Docker registry - username: ${{ secrets.DOCKER_HUB_USERNAME }} - # Password or personal access token used to log against the Docker registry - password: ${{ secrets.DOCKER_HUB_TOKEN }} - # Log out from the Docker registry at the end of a job - logout: true # optional, default is true - - - name: Set up Docker builder - id: buildx - uses: docker/setup-buildx-action@v1.6.0 - - - name: Build and push image - id: docker_build - uses: docker/build-push-action@v2 - with: - context: ./ - file: ./Dockerfile - push: true - # The test image is /docker and is private. final image will be /calendso and public - tags: docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/calendso:latest - build-args: | - BASE_URL=http://localhost:3000 - NEXT_PUBLIC_APP_URL=http://localhost:3000 - - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} From 94d5893c4e1f0580a4963bde3a7b888b99a1d318 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Tue, 26 Apr 2022 17:22:32 -0400 Subject: [PATCH 19/20] add deprecation for jwt_secret --- .env.example | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.env.example b/.env.example index 67138c7..3504c65 100644 --- a/.env.example +++ b/.env.example @@ -18,6 +18,9 @@ NEXT_PUBLIC_WEBAPP_URL=http://localhost:3000 # Use `openssl rand -base64 32` to generate a key NEXTAUTH_SECRET=secret +# Deprecation note: JWT_SECRET is no longer used +# JWT_SECRET=secret + POSTGRES_USER=unicorn_user POSTGRES_PASSWORD=magical_password POSTGRES_DB=calendso From 6f47b367a0553d973970c5a2a4dda6ece38ed5af Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Tue, 26 Apr 2022 17:32:02 -0400 Subject: [PATCH 20/20] update workflow to avoid recursive checkout --- .github/workflows/docker-build-push-dockerhub.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-build-push-dockerhub.yml b/.github/workflows/docker-build-push-dockerhub.yml index 8b2b451..92e6310 100644 --- a/.github/workflows/docker-build-push-dockerhub.yml +++ b/.github/workflows/docker-build-push-dockerhub.yml @@ -33,9 +33,12 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - with: - submodules: true + - name: checkout + uses: actions/checkout@v2 + + - name: Git submodule update + run: | + git submodule update --init - name: Docker Login # You may pin to the exact commit or the version.