Skip to content

Commit 1b756e5

Browse files
Enable hot reloading in Docker container #1771
* 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 <[email protected]>
1 parent fabe035 commit 1b756e5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docker-compose.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ services:
1515
command: /bin/sh -c "
1616
./manage.py migrate &&
1717
./manage.py collectstatic --no-input --verbosity 0 --clear &&
18-
gunicorn vulnerablecode.wsgi:application -u nobody -g nogroup --bind :8000 --timeout 600 --workers 8"
18+
gunicorn --reload vulnerablecode.wsgi:application -u nobody -g nogroup --bind :8000 --timeout 600 --workers 8"
1919
env_file:
2020
- docker.env
2121
expose:
2222
- 8000
2323
volumes:
24+
- .:/app
2425
- /etc/vulnerablecode/:/etc/vulnerablecode/
2526
- static:/var/vulnerablecode/static/
2627
depends_on:

0 commit comments

Comments
 (0)