Skip to content

Conversation

nuclearcat
Copy link
Member

Move environment variable definitions from docker-compose.yml to dedicated .env files. This change aligns with the 12factor.net recommendation of storing configuration in the environment.

  • Introduces .env.backend.example, .env.db.example, and .env.proxy.example to serve as templates.
  • Modifies docker-compose.yml to use env_file for each service.
  • Ensures that .env files are ignored by git.

@nuclearcat nuclearcat marked this pull request as ready for review August 18, 2025 12:41
Copy link
Collaborator

@MarceloRobert MarceloRobert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the env files without the .example to the gitignore

DASH_DB_PASSWORD=${DASH_DB_PASSWORD:-admin}
DASH_DB_HOST=dashboard_db
DASH_DB_PORT=${DASH_DB_PORT:-5432}
USE_DASHBOARD_DB=${USE_DASHBOARD_DB:-False} No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: leave an empty line at the end of file

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated/amended, please check

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The real environment variables for the database are POSTGRES_USER, POSTGRES_PASSWORD and POSTGRES_DB, even though there were being overriden by those other names. You can use the same syntax as it was being used before (like POSTGRES_USER=${DASH_DB_USER:-admin})

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated/amended, please check

@nuclearcat nuclearcat force-pushed the move-env-files branch 2 times, most recently from 4bdbf5b to 7844123 Compare August 19, 2025 08:26
@nuclearcat
Copy link
Member Author

Please add the env files without the .example to the gitignore

Updated/amended, please check

Move environment variable definitions from docker-compose.yml
to dedicated .env files. This change aligns with the 12factor.net
recommendation of storing configuration in the environment.

- Introduces .env.backend.example, .env.db.example, and
  .env.proxy.example to serve as templates.
- Modifies docker-compose.yml to use `env_file` for each service.
- Ensures that .env files are ignored by git.

Signed-off-by: Denys Fedoryshchenko <[email protected]>
@MarceloRobert
Copy link
Collaborator

Oh... I was about to approve this PR and add a not that we need to be careful with this because we need to make sure that staging/production have those .env files, and I just saw that the Github CI already broke. The docker services for the integration tests are not being able to run because it won't find any of the .env.something files, could you check that for us?

@nuclearcat
Copy link
Member Author

On staging/deployment i will deal with that, i will check workflows now.

@nuclearcat
Copy link
Member Author

I think that part is fine now, is other errors relevant?

@MarceloRobert
Copy link
Collaborator

I think that part is fine now, is other errors relevant?

The solution was easier than I though 😅
The other errors are just part of that "CI not working on PRs from forks" thing, so not relevant

Copy link
Collaborator

@MarceloRobert MarceloRobert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nuclearcat nuclearcat merged commit 435a63f into kernelci:main Aug 21, 2025
4 of 5 checks passed
@MarceloRobert MarceloRobert mentioned this pull request Aug 22, 2025
9 tasks
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.

2 participants