Skip to content

fix: add DATABASE_URL to .postgres env template to ensure it's available in all container contexts fix #6273#6404

Open
shriramThakare3 wants to merge 2 commits intocookiecutter:mainfrom
shriramThakare3:main
Open

fix: add DATABASE_URL to .postgres env template to ensure it's available in all container contexts fix #6273#6404
shriramThakare3 wants to merge 2 commits intocookiecutter:mainfrom
shriramThakare3:main

Conversation

@shriramThakare3
Copy link
Copy Markdown

@shriramThakare3 shriramThakare3 commented Mar 2, 2026

Description

I have added an explicit DATABASE_URL environment variable to the .env template. This ensures the connection URI is available in all container contexts (including docker exec sessions) rather than being dynamically exported only during the entrypoint execution.

I also added a single-line comment to the template to ensure developers keep the URI in sync with the individual POSTGRES_USER and POSTGRES_PASSWORD variables.

Checklist:

  • I've made sure that tests are updated accordingly (especially if adding or updating a template option)
  • I've updated the documentation or confirm that my change doesn't require any updates

Rationale

The current implementation constructs DATABASE_URL within entrypoint.sh. While this works for the primary container process, it does not persist for subsequent exec sessions or external debugging tools.

By moving this into the environment template:

  • Persistence: The variable remains available throughout the entire container lifecycle.
  • Clarity: Other developers can see exactly how the URI is constructed without digging into shell scripts.
  • Consistency: Using the same placeholders ensures that the user fills in credentials consistently across all fields.

@shriramThakare3 shriramThakare3 changed the title fix: add DATABASE_URL to .postgres env template to ensure it's available in all container contexts #6273 fix: add DATABASE_URL to .postgres env template to ensure it's available in all container contexts fix #6273 Mar 2, 2026
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.

1 participant