From db89df9e2070d531f24d9c40e06fb194a533925a Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Mon, 25 Jul 2022 18:37:02 -0400 Subject: [PATCH 1/7] update for buildx compatibility --- .../workflows/docker-build-push-dockerhub.yml | 62 ++++++++++--------- docker-compose.yaml | 16 ++--- 2 files changed, 42 insertions(+), 36 deletions(-) diff --git a/.github/workflows/docker-build-push-dockerhub.yml b/.github/workflows/docker-build-push-dockerhub.yml index 4f4e6bd..f64dc37 100644 --- a/.github/workflows/docker-build-push-dockerhub.yml +++ b/.github/workflows/docker-build-push-dockerhub.yml @@ -60,42 +60,48 @@ jobs: run: | grep -o '^[^#]*' .env.example > .env cat .env >> $GITHUB_ENV + echo "DATABASE_HOST=localhost:5432" >> $GITHUB_ENV + eval $(sed -e '/^#/d' -e 's/^/export /' -e 's/$/;/' .env) ; - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v2 - # with: - # driver-opts: | - # network=stack - name: Start database run: | docker compose up -d database + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + driver-opts: | + network=container:database + buildkitd-flags: | + --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host + -# - name: Build and push image -# id: docker_build -# uses: docker/build-push-action@v2 -# with: -# context: ./ -# file: ./Dockerfile -# push: false -# # platforms: linux/amd64,linux/arm64 -# # The test image is /docker and is private. final image will be /calendso and public -# tags: docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/calendso:canary -# # network: stack -# build-args: | -# NEXT_PUBLIC_WEBAPP_URL=${{ env.NEXT_PUBLIC_WEBAPP_URL }} -# NEXT_PUBLIC_LICENSE_CONSENT=${{ env.NEXT_PUBLIC_LICENSE_CONSENT }} -# NEXT_PUBLIC_TELEMETRY_KEY=${{ env.NEXT_PUBLIC_TELEMETRY_KEY }} -# DATABASE_URL=postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@${{ env.DATABASE_HOST }}/${{ env.POSTGRES_DB }} + - name: Build and push image + id: docker_build + uses: docker/build-push-action@v3 + with: + context: ./ + file: ./Dockerfile + push: false + platforms: linux/amd64,linux/arm64 + # The test image is /docker and is private. final image will be /calendso and public + tags: docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/calendso:canary +# network: stack + build-args: | + NEXT_PUBLIC_WEBAPP_URL=${{ env.NEXT_PUBLIC_WEBAPP_URL }} + NEXT_PUBLIC_LICENSE_CONSENT=${{ env.NEXT_PUBLIC_LICENSE_CONSENT }} + NEXT_PUBLIC_TELEMETRY_KEY=${{ env.NEXT_PUBLIC_TELEMETRY_KEY }} + DATABASE_URL=postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@${{ env.DATABASE_HOST }}/${{ env.POSTGRES_DB }} - - name: Build with docker compose - run: | - DOCKER_BUILDKIT=0 docker compose build --build-arg DATABASE_URL=postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@${{ env.DATABASE_HOST }}/${{ env.POSTGRES_DB }} calcom + # - name: Build with docker compose + # run: | + # DOCKER_BUILDKIT=0 docker compose build --build-arg DATABASE_URL=postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@${{ env.DATABASE_HOST }}/${{ env.POSTGRES_DB }} calcom - - name: Push docker image - run: | - docker tag docker_calcom:latest calendso/calendso:latest - docker push calendso/calendso:latest + # - name: Push docker image + # run: | + # docker tag docker_calcom:latest calendso/calendso:latest + # docker push calendso/calendso:latest - name: Cleanup run: | diff --git a/docker-compose.yaml b/docker-compose.yaml index ce3bf2a..dd39232 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,5 +1,5 @@ # Use postgres/example user/password credentials -version: '3.1' +version: '3.8' volumes: database-data: @@ -11,6 +11,7 @@ networks: services: database: + container_name: database image: postgres restart: always volumes: @@ -24,13 +25,12 @@ services: context: . dockerfile: Dockerfile args: - - NEXT_PUBLIC_WEBAPP_URL=${NEXT_PUBLIC_WEBAPP_URL} - - NEXT_PUBLIC_LICENSE_CONSENT=${NEXT_PUBLIC_LICENSE_CONSENT} - - CALCOM_TELEMETRY_DISABLED=${CALCOM_TELEMETRY_DISABLED} - - NEXTAUTH_SECRET=${NEXTAUTH_SECRET} - - CALENDSO_ENCRYPTION_KEY=${CALENDSO_ENCRYPTION_KEY} - - DATABASE_URL=${DATABASE_URL} - network: stack + NEXT_PUBLIC_WEBAPP_URL: ${NEXT_PUBLIC_WEBAPP_URL} + NEXT_PUBLIC_LICENSE_CONSENT: ${NEXT_PUBLIC_LICENSE_CONSENT} + CALCOM_TELEMETRY_DISABLE: ${CALCOM_TELEMETRY_DISABLED} + NEXTAUTH_SECRET: ${NEXTAUTH_SECRET} + CALENDSO_ENCRYPTION_KEY: ${CALENDSO_ENCRYPTION_KEY} + DATABASE_URL: ${DATABASE_URL} restart: always networks: - stack From 049bdcb02bdf66220d6e5b04b9dde4674eb877ca Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Mon, 25 Jul 2022 18:40:52 -0400 Subject: [PATCH 2/7] remove arm64 platform --- .github/workflows/docker-build-push-dockerhub.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-build-push-dockerhub.yml b/.github/workflows/docker-build-push-dockerhub.yml index f64dc37..72cd112 100644 --- a/.github/workflows/docker-build-push-dockerhub.yml +++ b/.github/workflows/docker-build-push-dockerhub.yml @@ -84,7 +84,8 @@ jobs: context: ./ file: ./Dockerfile push: false - platforms: linux/amd64,linux/arm64 + # platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 # The test image is /docker and is private. final image will be /calendso and public tags: docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/calendso:canary # network: stack From 6091f121f762fb694cfef1385c7ccdbc98773f8f Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Mon, 25 Jul 2022 18:47:11 -0400 Subject: [PATCH 3/7] add qemu --- .github/workflows/docker-build-push-dockerhub.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build-push-dockerhub.yml b/.github/workflows/docker-build-push-dockerhub.yml index 72cd112..07a065b 100644 --- a/.github/workflows/docker-build-push-dockerhub.yml +++ b/.github/workflows/docker-build-push-dockerhub.yml @@ -62,7 +62,9 @@ jobs: cat .env >> $GITHUB_ENV echo "DATABASE_HOST=localhost:5432" >> $GITHUB_ENV eval $(sed -e '/^#/d' -e 's/^/export /' -e 's/$/;/' .env) ; - + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 - name: Start database run: | @@ -76,7 +78,6 @@ jobs: buildkitd-flags: | --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host - - name: Build and push image id: docker_build uses: docker/build-push-action@v3 From 6134a66c2d228035ce99e8ce1fd8ca62b57ab334 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Mon, 25 Jul 2022 18:49:21 -0400 Subject: [PATCH 4/7] add arm64 to platforms --- .github/workflows/docker-build-push-dockerhub.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker-build-push-dockerhub.yml b/.github/workflows/docker-build-push-dockerhub.yml index 07a065b..0c83bfc 100644 --- a/.github/workflows/docker-build-push-dockerhub.yml +++ b/.github/workflows/docker-build-push-dockerhub.yml @@ -85,8 +85,7 @@ jobs: context: ./ file: ./Dockerfile push: false - # platforms: linux/amd64,linux/arm64 - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 # The test image is /docker and is private. final image will be /calendso and public tags: docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/calendso:canary # network: stack From 35cdfa1d5aea463b98302d718b52b40d41314ba3 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Mon, 25 Jul 2022 18:53:36 -0400 Subject: [PATCH 5/7] enable image push --- .github/workflows/docker-build-push-dockerhub.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/docker-build-push-dockerhub.yml b/.github/workflows/docker-build-push-dockerhub.yml index 0c83bfc..eac0325 100644 --- a/.github/workflows/docker-build-push-dockerhub.yml +++ b/.github/workflows/docker-build-push-dockerhub.yml @@ -84,11 +84,9 @@ jobs: with: context: ./ file: ./Dockerfile - push: false + push: true platforms: linux/amd64,linux/arm64 - # The test image is /docker and is private. final image will be /calendso and public tags: docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/calendso:canary -# network: stack build-args: | NEXT_PUBLIC_WEBAPP_URL=${{ env.NEXT_PUBLIC_WEBAPP_URL }} NEXT_PUBLIC_LICENSE_CONSENT=${{ env.NEXT_PUBLIC_LICENSE_CONSENT }} @@ -99,11 +97,6 @@ jobs: # run: | # DOCKER_BUILDKIT=0 docker compose build --build-arg DATABASE_URL=postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@${{ env.DATABASE_HOST }}/${{ env.POSTGRES_DB }} calcom - # - name: Push docker image - # run: | - # docker tag docker_calcom:latest calendso/calendso:latest - # docker push calendso/calendso:latest - - name: Cleanup run: | docker compose down From 8b23568c4bbb62461241ee7b63bc78081724f5e8 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Tue, 26 Jul 2022 10:10:11 -0400 Subject: [PATCH 6/7] add yarn timeout config for arm64 emulator help --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 30a51ae..2ce8712 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,8 @@ COPY calcom/package.json calcom/yarn.lock calcom/turbo.json ./ COPY calcom/apps/web ./apps/web COPY calcom/packages ./packages -RUN yarn install --frozen-lockfile +RUN yarn config set network-timeout 1000000000 -g && \ + yarn install --frozen-lockfile RUN yarn build From 566bf106ee4c0525770d2e4f13e66c2ce3d86b80 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Thu, 4 Aug 2022 16:14:19 -0400 Subject: [PATCH 7/7] re-add network stack to docker-compose build config --- docker-compose.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index dd39232..3140f52 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -31,6 +31,7 @@ services: NEXTAUTH_SECRET: ${NEXTAUTH_SECRET} CALENDSO_ENCRYPTION_KEY: ${CALENDSO_ENCRYPTION_KEY} DATABASE_URL: ${DATABASE_URL} + network: stack restart: always networks: - stack