Skip to content

feat(docker): Depends_on based on initializer#12584

Merged
mtesauro merged 1 commit into
DefectDojo:devfrom
kiblik:docker_compose_depends_on
Jun 12, 2025
Merged

feat(docker): Depends_on based on initializer#12584
mtesauro merged 1 commit into
DefectDojo:devfrom
kiblik:docker_compose_depends_on

Conversation

@kiblik

@kiblik kiblik commented Jun 10, 2025

Copy link
Copy Markdown
Contributor

This change blocks the start of uwsgi, celerybeat, and celeryworker until initializer is not completed_successfully. This is useful for:

  • avoiding errors in uwsgi, celerybeat, and celeryworker during start-up when the db is not ready
  • make it easier to identify errors with initializer (they might get easily lost within other logs).

@kiblik kiblik marked this pull request as ready for review June 10, 2025 17:26
@kiblik kiblik requested review from Maffooch and mtesauro as code owners June 10, 2025 17:26
@dryrunsecurity

Copy link
Copy Markdown

DryRun Security

No security concerns detected in this pull request.


All finding details can be found in the DryRun Security Dashboard.

@valentijnscholten valentijnscholten left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Cool! What happens when there is an error in the initializer? I guess it just fails with an error and the other containers are never started?

@valentijnscholten valentijnscholten added this to the 2.48.0 milestone Jun 11, 2025
@kiblik

kiblik commented Jun 11, 2025

Copy link
Copy Markdown
Contributor Author

Cool! What happens when there is an error in the initializer? I guess it just fails with an error and the other containers are never started?

Exactly (well, except psql and redis - they do not use dependency, so they would still be running)

For testing, I changed models.py, did not prepare migrations, initializer failed, and the whole process of startup stopped (docker did not touch uwsgi, nginx or celery*). This was the last message before coming back to bash.

service "initializer" didn't complete successfully: exit 1

@Maffooch Maffooch requested a review from dogboat June 12, 2025 00:05
@mtesauro

Copy link
Copy Markdown
Contributor

Excellent work here 🚀

@mtesauro mtesauro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved

@mtesauro mtesauro merged commit 6b0f0c5 into DefectDojo:dev Jun 12, 2025
77 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants