cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

fix: production ready docker build with ci workflow

Open ChichiCaleb opened this issue 1 year ago โ€ข 16 comments

What does this PR do?

builds a production ready docker image

  • builds a leaner and more secure docker image (< 1/3) the size of the current calcom image

  • abilty to change host and any chosen inlined build time variable with runtime variable

  • db migration at runtime

  • implemented postgres healthcheck and service_healthy option in compose removing the need for wait-for-it script

  • ability to run unit test in docker

builds a full featured ci with ability to:

  • build a test image and push to GHCR which will subequently be pulled by integration-test and trivy scan jobs for their respective actions

  • builds and runs unit test specified in the repo by targeting unit-test layer of multistage docker build however uses the cache from test image to save time

  • pulls test image from GHCR and runs integration test in docker compose

  • pulls test image from GHCR and run a trivy vulnerability scan for high and crtical CVEs (non-blocking) and uploads the sarif result to github security tab

  • generates changelog.MD file and create releases using conventional commits.

    • creates a prelease when a pull request is made to main branch following a succesful unit and integration test.

    • creates a release when a merge is made to the main branch and adds either the prelease or released version to github output to be used by final image published to docker hub

  • builds the final image and adds latest tag and image:V*.*.* semantic versioning tag to merge request and image:v*.*.*-alpha.* tag to pull requests made to main branch before pushing to dockerhub

  • adds the Docker image tag(s)/labels pushed to docker hub,to the pull request comment section for reference purpose

Fixes #12032

Requirement/Documentation

  • In repo settings under actions enable:

    • Read and write permissions
  • create a github Personal access Token and add as repo secret with the name RELEASE_MAIN for automated changelog generation and release enabling the following:

    • Repo
    • workflow
    • write package
    • admin:org
  • In repo settings under rules enable:

    • repository admin bypass list

Type of change

  • Chore (refactoring code, technical debt, workflow improvements)

How should this be tested?

  git clone https://github.com/calcom/cal.com.git
  • Duplicate .env.example to .env in infra/docker/web

  • A workflow flow run, pull request or merge request triggers the ci workflow

  • start the services in docker compose and test locally with:

    docker compose -f infra/docker/web/docker-compose.yaml up
    

Mandatory Tasks

  • [x] Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

ChichiCaleb avatar Feb 05 '24 15:02 ChichiCaleb

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

:white_check_mark: keithwillcode
:x: chichi


chichi seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Feb 05 '24 15:02 CLAassistant

Thank you for following the naming conventions! ๐Ÿ™ Feel free to join our discord and post your PR link.

github-actions[bot] avatar Feb 05 '24 15:02 github-actions[bot]

๐Ÿ“ฆ Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. ๐Ÿค–

This PR introduced no changes to the JavaScript bundle! ๐Ÿ™Œ

github-actions[bot] avatar Feb 05 '24 16:02 github-actions[bot]

Wow, thanks so much for this contribution, @ChichiCaleb. Weโ€™ve slotted it to be reviewed during the 3.9 milestone which starts the 15th. ๐Ÿ™๐Ÿผ

keithwillcode avatar Feb 06 '24 11:02 keithwillcode

thanks for the great work this community has been doing

ChichiCaleb avatar Feb 06 '24 13:02 ChichiCaleb

Someone is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Feb 08 '24 17:02 vercel[bot]

If we merge this PR means that the calcom/docker repo would be deprecated?

zomars avatar Feb 08 '24 19:02 zomars

looking forward to this PR being merged

compgeniuses avatar Feb 21 '24 04:02 compgeniuses

This PR is being marked as stale due to inactivity.

github-actions[bot] avatar Mar 07 '24 00:03 github-actions[bot]

@ChichiCaleb and @PeerRich how is this coming along?

compgeniuses avatar Mar 08 '24 01:03 compgeniuses

This PR is being marked as stale due to inactivity.

github-actions[bot] avatar Mar 23 '24 00:03 github-actions[bot]

This PR is being marked as stale due to inactivity.

github-actions[bot] avatar Apr 11 '24 00:04 github-actions[bot]

I was under the impression that this was slated for v4 release...

compgeniuses avatar Apr 15 '24 05:04 compgeniuses

This PR is being marked as stale due to inactivity.

github-actions[bot] avatar Apr 30 '24 00:04 github-actions[bot]

New and removed dependencies detected. Learn more about Socket for GitHub โ†—๏ธŽ

Package New capabilities Transitives Size Publisher
npm/@adobe/[email protected] None 0 180 kB adobe-admin
npm/@babel/[email protected] None 0 158 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 14.1 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 10.7 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 650 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 262 kB nicolo-ribaudo
npm/@babel/[email protected] None 0 68.9 kB nicolo-ribaudo
npm/@babel/[email protected] environment 0 2.41 MB nicolo-ribaudo
npm/@emotion/[email protected] environment 0 30.8 kB emotion-release-bot
npm/@emotion/[email protected] environment 0 7.05 kB emotion-release-bot
npm/@emotion/[email protected] environment 0 7.38 kB emotion-release-bot
npm/@emotion/[email protected] environment 0 18.3 kB emotion-release-bot
npm/@esbuild/[email protected] None 0 11.5 MB evanw
npm/@esbuild/[email protected] None 0 9.83 MB evanw
npm/@esbuild/[email protected] None 0 11.5 MB evanw
npm/@esbuild/[email protected] None 0 9.78 MB evanw
npm/@esbuild/[email protected] None 0 10.2 MB evanw
npm/@esbuild/[email protected] None 0 8.85 MB evanw
npm/@esbuild/[email protected] None 0 9.63 MB evanw
npm/@esbuild/[email protected] None 0 9.18 MB evanw
npm/@esbuild/[email protected] None 0 8.85 MB evanw
npm/@esbuild/[email protected] None 0 9.16 MB evanw
npm/@esbuild/[email protected] None 0 9.37 MB evanw
npm/@esbuild/[email protected] None 0 10.4 MB evanw
npm/@esbuild/[email protected] None 0 9.18 MB evanw
npm/@esbuild/[email protected] None 0 9.11 MB evanw
npm/@esbuild/[email protected] None 0 10.1 MB evanw
npm/@esbuild/[email protected] None 0 9.62 MB evanw
npm/@esbuild/[email protected] None 0 9.6 MB evanw
npm/@esbuild/[email protected] None 0 9.64 MB evanw
npm/@esbuild/[email protected] None 0 9.6 MB evanw
npm/@esbuild/[email protected] None 0 9 MB evanw
npm/@esbuild/[email protected] None 0 9.47 MB evanw
npm/@esbuild/[email protected] None 0 9.83 MB evanw
npm/@eslint-community/[email protected] None 0 431 kB eslint-community-bot
npm/@eslint/[email protected] None 0 13.9 kB eslintbot
npm/@faker-js/[email protected] None 0 10.2 MB shinigami92
npm/@humanwhocodes/[email protected] None 0 55.6 kB nzakas
npm/@humanwhocodes/[email protected] unsafe 0 21.2 kB nzakas
npm/@jridgewell/[email protected] None 0 92.3 kB jridgewell
npm/@next/[email protected] environment, filesystem 0 11.7 kB vercel-release-bot
npm/@next/[email protected] None 0 115 MB vercel-release-bot
npm/@next/[email protected] None 0 117 MB vercel-release-bot
npm/@next/[email protected] None 0 116 MB vercel-release-bot
npm/@next/[email protected] None 0 140 MB vercel-release-bot
npm/@next/[email protected] None 0 131 MB vercel-release-bot
npm/@next/[email protected] None 0 157 MB vercel-release-bot
npm/@next/[email protected] None 0 102 MB vercel-release-bot
npm/@next/[email protected] None 0 93.9 MB vercel-release-bot
npm/@next/[email protected] None 0 136 MB vercel-release-bot
npm/@pkgjs/[email protected] None 0 74.2 kB oss-bot
npm/@playwright/[email protected] None +1 3.07 MB yurys
npm/@prisma/[email protected] environment, filesystem, shell 0 8.93 MB prismabot
npm/@prisma/[email protected] environment 0 25.2 kB prismabot
npm/@prisma/engines-version@5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b None 0 12.7 kB prismabot
npm/@prisma/[email protected] environment 0 95 kB prismabot
npm/@prisma/[email protected] environment, eval, filesystem 0 1.64 MB prismabot
npm/@prisma/[email protected] environment, filesystem, shell 0 614 kB prismabot
npm/@protobufjs/[email protected] None 0 9.05 kB dcode
npm/@protobufjs/[email protected] None 0 9.22 kB dcode
npm/@protobufjs/[email protected] None 0 9.14 kB dcode
npm/@protobufjs/[email protected] None 0 7.75 kB dcode
npm/@protobufjs/[email protected] None 0 27 kB dcode
npm/@protobufjs/[email protected] None 0 4.29 kB dcode
npm/@protobufjs/[email protected] None 0 7.77 kB dcode
npm/@protobufjs/[email protected] None 0 6.25 kB dcode
npm/@protobufjs/[email protected] None 0 23.5 kB dcode
npm/@rollup/[email protected] None 0 1.69 MB lukastaegert
npm/@rollup/[email protected] None 0 2.57 MB lukastaegert
npm/@rollup/[email protected] None 0 2.49 MB lukastaegert
npm/@rollup/[email protected] None 0 2.64 MB lukastaegert
npm/@rollup/[email protected] None 0 2.53 MB lukastaegert
npm/@rollup/[email protected] None 0 2.55 MB lukastaegert
npm/@rollup/[email protected] None 0 2.43 MB lukastaegert
npm/@rollup/[email protected] None 0 2.61 MB lukastaegert
npm/@rollup/[email protected] None 0 2.78 MB lukastaegert
npm/@rollup/[email protected] None 0 2.78 MB lukastaegert
npm/@rollup/[email protected] None 0 3.03 MB lukastaegert
npm/@rollup/[email protected] None 0 2.72 MB lukastaegert
npm/@rollup/[email protected] None 0 3.63 MB lukastaegert
npm/@stablelib/[email protected] None 0 46.1 kB dchest
npm/@swc/[email protected] None 0 1.18 kB kdy1
npm/@swc/[email protected] None 0 230 kB kdy1
npm/@trpc/[email protected] network 0 253 kB katt
npm/@trpc/[email protected] environment 0 713 kB katt
npm/@tsconfig/[email protected] None 0 2.31 kB typescript-deploys
npm/@tsconfig/[email protected] None 0 2.45 kB typescript-deploys
npm/@types/[email protected] None 0 6.27 kB types
npm/@types/[email protected] None 0 192 kB types
npm/@types/[email protected] None 0 9.12 kB types
npm/@types/[email protected] None 0 6.71 kB types
npm/@types/[email protected] None 0 438 kB types
npm/@ungap/[email protected] None 0 26.2 kB webreflection
npm/@webassemblyjs/[email protected] None 0 207 kB xtuc
npm/@webassemblyjs/[email protected] None 0 5.14 kB xtuc
npm/@webassemblyjs/[email protected] None 0 5.4 kB xtuc
npm/@webassemblyjs/[email protected] None 0 10.8 kB xtuc
npm/@webassemblyjs/[email protected] None 0 6.68 kB xtuc
npm/@webassemblyjs/[email protected] None 0 16 kB xtuc
npm/@webassemblyjs/[email protected] None 0 19.7 kB xtuc
npm/@webassemblyjs/[email protected] None 0 3.18 kB xtuc
npm/@webassemblyjs/[email protected] None 0 30.7 kB xtuc
npm/@webassemblyjs/[email protected] None 0 7.31 kB xtuc
npm/@webassemblyjs/[email protected] None 0 34.6 kB xtuc
npm/@webassemblyjs/[email protected] None 0 28.1 kB xtuc
npm/@webassemblyjs/[email protected] None 0 14.4 kB xtuc
npm/@webassemblyjs/[email protected] None 0 129 kB xtuc
npm/@webassemblyjs/[email protected] None 0 39.6 kB xtuc
npm/@xtuc/[email protected] None 0 8.57 kB xtuc
npm/@xtuc/[email protected] None 0 190 kB xtuc
npm/[email protected] None 0 10.4 kB jeffcarp
npm/[email protected] None 0 16.8 kB dougwilson
npm/[email protected] None 0 25.7 kB xtuc
npm/[email protected] None 0 17 kB sindresorhus
npm/[email protected] None 0 22.2 kB kevinbeaty
npm/[email protected] None 0 192 kB jessebeach
npm/[email protected] None 0 4.42 kB blakeembrey
npm/[email protected] None 0 5.03 kB sindresorhus
npm/[email protected] None 0 217 kB lancedikson
npm/[email protected] None 0 11.5 kB juliangruber
npm/[email protected] environment, filesystem 0 62.8 kB ai
npm/[email protected] None 0 124 kB mscdex
npm/[email protected] None 0 12.3 kB dougwilson
npm/[email protected] None 0 81.8 kB egoist
npm/[email protected] None 0 754 kB keithamus
npm/[email protected] None 0 4.96 kB richienb
npm/[email protected] filesystem 0 5.71 kB isaacs
npm/[email protected] None 0 14.2 kB samccone
npm/[email protected] None 0 12.2 kB salakar
npm/[email protected] None +1 33.9 kB qix
npm/[email protected] None 0 3.94 kB natevw
npm/[email protected] None 0 23.1 kB dougwilson
npm/[email protected] None 0 11.7 kB mesqueeb
npm/[email protected] None 0 20 kB dougwilson
npm/[email protected] environment, filesystem, shell 0 21.2 kB satazor
npm/[email protected] None 0 283 kB mikemcl
npm/[email protected] None 0 24.2 kB chai
npm/[email protected] environment, eval 0 27.1 kB dougwilson
npm/[email protected] None 0 14.2 kB lukeed
npm/[email protected] filesystem 0 9.02 kB dougwilson
npm/[email protected] None 0 7.86 kB dougwilson
npm/[email protected] unsafe 0 210 kB evilebottnawi
npm/[email protected] None 0 2.38 MB ljharb
npm/[email protected] None 0 90.6 kB guybedford
npm/[email protected] environment, filesystem, network, shell +1 10.6 MB evanw
npm/[email protected] None 0 146 kB eslintbot
npm/[email protected] None 0 1 MB michaelficarra
npm/[email protected] None 0 13.5 kB michaelficarra
npm/[email protected] filesystem 0 10.8 kB dougwilson
npm/[email protected] None 0 10.1 kB dougwilson
npm/[email protected] filesystem 0 2.22 kB mafintosh
npm/[email protected] None 0 8.68 kB keithamus
npm/[email protected] None 0 18.1 kB nickfitzgerald
npm/[email protected] None 0 23.7 kB ljharb
npm/[email protected] filesystem 0 21.8 kB sindresorhus
npm/[email protected] None 0 812 kB mattpauldavies
npm/[email protected] None 0 5.14 kB sindresorhus
npm/[email protected] None 0 3.08 kB sindresorhus
npm/[email protected] None 0 2.82 kB sindresorhus
npm/[email protected] None 0 3.92 kB mathias
npm/[email protected] None 0 45.1 kB mesqueeb
npm/[email protected] environment 0 253 kB isaacs
npm/[email protected] eval, filesystem 0 18.4 kB sokra
npm/[email protected] None 0 26.5 kB jdalton
npm/[email protected] None 0 119 kB dcode
npm/[email protected] None 0 58.1 kB keithamus
npm/[email protected] None 0 452 kB antfu
npm/[email protected] None 0 9.49 kB sindresorhus
npm/[email protected] None 0 4.89 kB dougwilson
npm/[email protected] network 0 5.29 kB dougwilson
npm/[email protected] environment, filesystem 0 51.7 kB broofa
npm/[email protected] None 0 8.24 kB sindresorhus
npm/[email protected] None 0 24.4 kB ai
npm/[email protected] None 0 298 kB suguru03
npm/[email protected] None 0 79.7 kB diego
npm/[email protected] None 0 59 kB addaleax
npm/[email protected] None 0 788 kB vitaly
npm/[email protected] None 0 702 kB feedic
npm/[email protected] None 0 10.3 kB dougwilson
npm/[email protected] filesystem +1 1.21 MB isaacs
npm/[email protected] None 0 62 kB pi0
npm/[email protected] environment, filesystem, unsafe 0 11.2 MB prettier-bot
npm/[email protected] None 0 7.47 kB sindresorhus
npm/[email protected] None 0 6.36 kB cwmma
npm/[email protected] network, unsafe 0 25.8 kB dougwilson
npm/[email protected] environment 0 4.51 MB react-bot
npm/[email protected] environment 0 124 kB matteo.collina
npm/[email protected] filesystem 0 20.5 kB paulmillr
npm/[email protected] None 0 9.09 kB jonschlinkert
npm/[email protected] None 0 18.9 kB tim-kos
npm/[email protected] None 0 25.2 kB matteo.collina
npm/[email protected] filesystem +1 72.4 kB isaacs
npm/[email protected] environment, filesystem +3 12.2 MB lukastaegert
npm/[email protected] None 0 52.1 kB fitz5264
npm/[email protected] None 0 4.5 MB blesh
npm/[email protected] None 0 16.4 kB ljharb
npm/[email protected] None 0 164 kB lddubeau
npm/[email protected] None 0 16.9 kB redonkulus
npm/[email protected] None 0 4.79 kB emilbayes
npm/[email protected] None 0 6.88 kB shtylman
npm/[email protected] network 0 7.09 kB boneskull
npm/[email protected] None +1 9.64 kB sindresorhus
npm/[email protected] environment 0 1.03 MB vercel-release-bot
npm/[email protected] None 0 46.9 kB sokra
npm/[email protected] None 0 51 kB aslemammad
npm/[email protected] None 0 2.77 kB daaku
npm/[email protected] None 0 22.9 kB jonschlinkert
npm/[email protected] None +1 117 kB ccasey
npm/[email protected] shell 0 7.82 kB wmhilton
npm/[email protected] None 0 3.85 kB sindresorhus
npm/[email protected] None 0 828 kB joshuakgoldberg
npm/[email protected] None 0 23.3 kB ljharb
npm/[email protected] None 0 4.31 kB dougwilson
npm/[email protected] environment 0 14.3 kB ai
npm/[email protected] None 0 470 kB garycourt
npm/[email protected] None 0 3.72 kB jaredhanson
npm/[email protected] None 0 8.75 kB dougwilson
npm/[email protected] environment, filesystem 0 56.2 kB evilebottnawi
npm/[email protected] None 0 24.2 kB domenic
npm/[email protected] None 0 91.3 kB sokra
npm/[email protected] filesystem, unsafe 0 7.25 kB mafintosh
npm/[email protected] environment, network 0 141 kB lpinca
npm/[email protected] environment, filesystem 0 124 kB oss-bot
npm/[email protected] None 0 667 kB colinmcd94

๐Ÿšฎ Removed packages: npm/@aashutoshrathi/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2, npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@discoveryjs/[email protected], npm/@emotion/[email protected], npm/@gar/[email protected], npm/@graphql-typed-document-node/[email protected], npm/@hapi/[email protected], npm/@hapi/[email protected], npm/@iarna/[email protected], npm/@jest/[email protected], npm/@jest/[email protected], npm/@jest/[email protected], npm/@jest/[email protected], npm/@jest/[email protected], npm/@jest/[email protected], npm/@jest/[email protected], npm/@jest/[email protected], npm/@noble/[email protected], npm/@scure/[email protected], npm/@sinclair/[email protected], npm/@sindresorhus/[email protected], npm/@sinonjs/[email protected], npm/@sinonjs/[email protected], npm/@szmarczak/[email protected], npm/@tootallnate/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@xmldom/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full reportโ†—๏ธŽ

socket-security[bot] avatar May 09 '24 17:05 socket-security[bot]

No dependency changes detected. Learn more about Socket for GitHub โ†—๏ธŽ

๐Ÿ‘ No dependency changes detected in pull request

socket-security[bot] avatar May 09 '24 17:05 socket-security[bot]

@emrysal have you seen this PR? I know you've been experimenting with the docker builds.

joeauyeung avatar Jun 14 '24 21:06 joeauyeung

its interesting that this keeps getting pushed forward...

compgeniuses avatar Jun 19 '24 17:06 compgeniuses

@ChichiCaleb can you pls fix the conflict?

anikdhabal avatar Jul 18 '24 06:07 anikdhabal

@anikdhabal just removed the conflicting output mode from next config file. My implementation made the output opinionated, can be changed under apps/web/config/build-env-config.js. current default is classic with standalone output being set from dockerfile using env variables, if you wish to make the default standalone it can also be done in the build-env-config.js file. Also review the ci workflow and make adjustments ,added some logic relating to updating manifest with image tag. Since kubernetes is not yet supported this can be adjusted as needed.

ChichiCaleb avatar Jul 18 '24 07:07 ChichiCaleb

@ChichiCaleb We are finally coming around to deeply reviewing our Docker builds and supporting them better.

Upon first review, it stands out to me that there's a lot of duplicated jobs in 3 separate files for pull_request, pull_request_target, and push_merge.

Can you please explain?

keithwillcode avatar Jul 22 '24 11:07 keithwillcode

@keithwillcode just merged into a single docker-ci

ChichiCaleb avatar Jul 22 '24 13:07 ChichiCaleb

It is needed by the replace-placeholder.sh due to next.js inline embedding of variables to avoid multiple docker image build for each environment.

  • The script reads each line from the placeholder.yml file, splits it into a key and a value based on the colon (:) delimiter, and trims any leading or trailing whitespace from the key and value.

  • For each key-value pair from the placeholder.yml file, the script iterates over all environment variables (could be docker compose env variable or even env variable in kubernetes manifest)to find a match. If a match is found and the environment variable has a non-empty value, the script uses sed to replace the placeholder value in the .next folder with the environment variable value. It excludes .git directories from this operation.

SO basically the keys in placeholder.yaml are used to check for similar entries in env variable while the values in placeholder.yaml are used to check for actual strings that need replacement in .next folder

this is the best I could come up with as at the time to enable reusable single docker build

ChichiCaleb avatar Jul 23 '24 09:07 ChichiCaleb

Going to put this back into draft for now as there are a couple of things I'd like to put into this

  1. Remove the job we have in the repo that kicks off the downstream Docker jobs in cal.com/docker.
  2. Deal with the placeholder environment variables.
  3. Change this a bit so that it doesn't run these expensive Docker builds too often. We recently introduced a ready-for-e2e label that is checked before running the entire E2E test suite, since it's slow and expensive. Would like to introduce something similar for this.

keithwillcode avatar Jul 23 '24 12:07 keithwillcode

its funny how everytime there is a major Update released, i ussuall come back here to check on this PR if its been merged.

compgeniuses avatar Oct 15 '24 21:10 compgeniuses