Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing build-time env variables to run-time only #312

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gabidb
Copy link

@gabidb gabidb commented Dec 3, 2023

What does this PR do?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant