Skip to content

Commit

Permalink
Add a run-docker-dev Makefile command (#1480)
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <[email protected]>
  • Loading branch information
tdruez authored Dec 18, 2024
1 parent 005a5e0 commit 26ded5e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ sqlitedb:
run:
${MANAGE} runserver 8001 --insecure

run-docker-dev:
@echo "-> Run the Docker compose services in dev mode (hot reload on code changes)"
docker compose -f docker-compose.yml -f docker-compose.dev.yml up

test:
@echo "-> Run the test suite"
${MANAGE} test --noinput
Expand Down Expand Up @@ -156,4 +160,4 @@ offline-package: docker-images
@mkdir -p dist/
@tar -cf dist/scancodeio-offline-package-`git describe --tags`.tar build/

.PHONY: virtualenv conf dev envfile install doc8 check valid check-deploy clean migrate upgrade postgresdb sqlitedb backupdb run test fasttest docs bump docker-images offline-package
.PHONY: virtualenv conf dev envfile install doc8 check valid check-deploy clean migrate upgrade postgresdb sqlitedb backupdb run run-docker-dev test fasttest docs bump docker-images offline-package
4 changes: 4 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@

services:
web:
env_file:
- docker.dev.env
volumes:
- ./scanpipe:/opt/scancodeio/scanpipe

worker:
env_file:
- docker.dev.env
volumes:
- ./scanpipe:/opt/scancodeio/scanpipe
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
command: wait-for-it --strict --timeout=60 db:5432 -- sh -c "
./manage.py migrate &&
./manage.py collectstatic --no-input --verbosity 0 --clear &&
gunicorn scancodeio.wsgi:application --bind :8000 --timeout 600 --workers 8"
gunicorn scancodeio.wsgi:application --bind :8000 --timeout 600 --workers 8 ${GUNICORN_RELOAD_FLAG}"
env_file:
- docker.env
expose:
Expand Down
2 changes: 2 additions & 0 deletions docker.dev.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SCANCODEIO_DEBUG=True
GUNICORN_RELOAD_FLAG=--reload
5 changes: 4 additions & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,10 @@ production servers.
make sqlitedb

.. warning::
Choosing SQLite over PostgreSQL has some caveats. Check this `link
SQLite is not recommended as a database backend. Certain built-in pipelines
depend on PostgreSQL-specific features and will fail when using SQLite.
For full functionality and reliability, PostgreSQL should be used.
Check this `link
<https://docs.djangoproject.com/en/dev/ref/databases/#sqlite-notes>`_
for more details.

Expand Down

0 comments on commit 26ded5e

Please sign in to comment.