Skip to content

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

Closed
BalaSubramaniam12007 wants to merge 1 commit into
aboutcode-org:mainfrom
BalaSubramaniam12007:enable-hot-reloading
Closed

BalaSubramaniam12007 wants to merge 1 commit into
aboutcode-org:mainfrom
BalaSubramaniam12007:enable-hot-reloading

Conversation

@BalaSubramaniam12007

Copy link
Copy Markdown

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
Copy Markdown
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.

@keshav-space

Copy link
Copy Markdown
Member

@BalaSubramaniam12007 thanks for your interest. docker-compose.yml is meant for production and the change you introduced in this PR are not desirable for production. We should instead use docker-compose.dev.yml. Let’s flesh this out in #1771.

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

2 participants