calcom / docker

The Docker configuration for Cal.com 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.
MIT License
619 stars 323 forks source link

fix: makes docker usable for production #313

Closed adrian-d-hidalgo closed 4 months ago

adrian-d-hidalgo commented 7 months ago

What does this PR do?

This PR removes unnecessary code and processes and updates some commands to build a production bundle.

This PR complements https://github.com/calcom/cal.com/pull/12686, so it should be updated to the latest commit to work correctly once merged.

Fixes #12032

Type of change

How should this be tested?

emrysal commented 7 months ago

@krumware for visibility.

The Docker build issues (or rather, having to rebuild after doing a docker pull to get the right env vars sorted) is an application issue; Could you elaborate more how this aims to resolve that?

PIG208 commented 7 months ago

Would it be helpful to revive #147?

adrian-d-hidalgo commented 7 months ago

@krumware for visibility.

The Docker build issues (or rather, having to rebuild after doing a docker pull to get the right env vars sorted) is an application issue; Could you elaborate more how this aims to resolve that?

Hi @emrysal, I just pushed an update; the main goal now is that the image build process installs yarn dependencies and executes yarn build to generate the project bundle using mock environment variables (if you don't have them during the build process fails, this can later be overriden).

Finally you have the Docker image built you can bind .env files to pass your runtime variables like this:

docker run -p 127.0.0.1:3000:3000/tcp --volume "$(pwd)/.env:/calcom/.env" --volume "$(pwd)/.env.appStore:/calcom/.env.appStore"

With this new approach you can have an Official Docker Image that can be deployed individually that doesn't get generated with env keys, this satisfies with the issue that env variables should be runtime only now.

compgeniuses commented 5 months ago

looking forward to the implementations of these

compgeniuses commented 5 months ago

so the other PR seems to have closed in favour of this https://github.com/calcom/cal.com/pull/13541

komali2 commented 4 months ago

If I copy this PR, and follow the instructions, and then run docker compose up, i get this error:

[+] Building 6.2s (3/3) FINISHED                                                                                                    docker:default
 => [calcom internal] load build definition from Dockerfile                                                                                   0.9s
 => => transferring dockerfile: 1.45kB                                                                                                        0.0s
 => [calcom internal] load metadata for docker.io/library/node:18                                                                             0.1s
 => ERROR [calcom internal] load metadata for docker.io/library/builder-two:latest                                                            1.8s
------
 > [calcom internal] load metadata for docker.io/library/builder-two:latest:
------
failed to solve: builder-two: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed