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
646
stars
338
forks
source link
Changing build-time env variables to run-time only #312
Fixes [CAL-2635] by changing build-time environment variables to run-time.
Type of change
Bug fix (non-breaking change which fixes an issue)
How should this be tested?
Scenario 1: Verify Image Build and Container Run
Build the image with (here you can see the logs):
docker build --build-arg DATABASE_URL="postgresql://postgres:@host.docker.internal:5432/calendso" -t calcom-image-test .
Run a container using the image with runtime variables:
docker run \ -e NEXTAUTH_SECRET="your_secret" \ -e DA TABASE_URL="your_database_url" \ -e CALENDSO_ENCRYPTION_KEY="your_key" \ -e NEXT_PUBLIC_WEBAPP_URL="http://localhost:3000" calcom-image-test
Expected Outcome: The container should start successfully with the provided variables. Test with invalid data to verify failure at runtime.
Scenario 2: Docker Compose
Start the setup using:
docker compose up -d
Disclaimer
At this point Build arguments cannot be removed as there are checks in the background for the existence of these variables.
While this makes sense when setting those variables build-time, when requiring the variables to be set only run-time, these checks might be redundant.
What does this PR do?
Fixes [CAL-2635] by changing build-time environment variables to run-time.
Type of change
How should this be tested?
Scenario 1: Verify Image Build and Container Run
Build the image with (here you can see the logs):
docker build --build-arg DATABASE_URL="postgresql://postgres:@host.docker.internal:5432/calendso" -t calcom-image-test .
Run a container using the image with runtime variables:
docker run \ -e NEXTAUTH_SECRET="your_secret" \ -e DA TABASE_URL="your_database_url" \ -e CALENDSO_ENCRYPTION_KEY="your_key" \ -e NEXT_PUBLIC_WEBAPP_URL="http://localhost:3000" calcom-image-test
Expected Outcome: The container should start successfully with the provided variables. Test with invalid data to verify failure at runtime.
Scenario 2: Docker Compose
docker compose up -d
Disclaimer
At this point Build arguments cannot be removed as there are checks in the background for the existence of these variables. While this makes sense when setting those variables build-time, when requiring the variables to be set only run-time, these checks might be redundant.