Skip to content

Commit 26ded5e

Browse files
authored
Add a run-docker-dev Makefile command (#1480)
Signed-off-by: tdruez <tdruez@nexb.com>
1 parent 005a5e0 commit 26ded5e

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ sqlitedb:
121121
run:
122122
${MANAGE} runserver 8001 --insecure
123123

124+
run-docker-dev:
125+
@echo "-> Run the Docker compose services in dev mode (hot reload on code changes)"
126+
docker compose -f docker-compose.yml -f docker-compose.dev.yml up
127+
124128
test:
125129
@echo "-> Run the test suite"
126130
${MANAGE} test --noinput
@@ -156,4 +160,4 @@ offline-package: docker-images
156160
@mkdir -p dist/
157161
@tar -cf dist/scancodeio-offline-package-`git describe --tags`.tar build/
158162

159-
.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
163+
.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

docker-compose.dev.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@
77

88
services:
99
web:
10+
env_file:
11+
- docker.dev.env
1012
volumes:
1113
- ./scanpipe:/opt/scancodeio/scanpipe
1214

1315
worker:
16+
env_file:
17+
- docker.dev.env
1418
volumes:
1519
- ./scanpipe:/opt/scancodeio/scanpipe

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ services:
2222
command: wait-for-it --strict --timeout=60 db:5432 -- sh -c "
2323
./manage.py migrate &&
2424
./manage.py collectstatic --no-input --verbosity 0 --clear &&
25-
gunicorn scancodeio.wsgi:application --bind :8000 --timeout 600 --workers 8"
25+
gunicorn scancodeio.wsgi:application --bind :8000 --timeout 600 --workers 8 ${GUNICORN_RELOAD_FLAG}"
2626
env_file:
2727
- docker.env
2828
expose:

docker.dev.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SCANCODEIO_DEBUG=True
2+
GUNICORN_RELOAD_FLAG=--reload

docs/installation.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,10 @@ production servers.
343343
make sqlitedb
344344

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

0 commit comments

Comments
 (0)