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

Add a bind mount and reload flag for hot reloading #1772

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

Conversation

BalaSubramaniam12007
Copy link

This PR fixes #1771 by enabling hot reloading inside Docker containers, allowing code changes to be reflected without requiring a full rebuild.

Changes Introduced:

  1. Added a bind mount in docker-compose.yml to sync local code with the container.
  2. Updated Gunicorn command to include the--reloadflag, ensuring automatic reloading of the application.
  3. Tested the solution, confirming that code changes are reflected in real-time without requiring a docker compose up --build.

How to Test the Fix:

  1. Start the updated Docker container.
  2. Modify UI elements.
  3. Refresh the browser and verify that the changes are applied instantly.
  4. Check logs to ensure the application reloads automatically:
    docker compose logs -f vulnerablecode

@BalaSubramaniam12007 BalaSubramaniam12007 changed the title Add a bind mount and reload flag for hot reloading #1771 Add a bind mount and reload flag for hot reloading Feb 6, 2025
* Add bind mount in docker-compose.yml to sync local code
* Use --reload flag in Gunicorn to auto-restart on code changes
* Improves developer experience by reducing rebuild time

Signed-off-by: Balasubramaniam12007 <balasubramaniam12007@gmail.com>
@BalaSubramaniam12007 BalaSubramaniam12007 marked this pull request as ready for review February 6, 2025 10:31
@BalaSubramaniam12007
Copy link
Author

@pombredanne I have added the hot reloading in docker container for easy development process, please review it and let me know if any further changes are required.

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.

Enable Hot Reloading in Docker Container
1 participant