From 861db36cf11d530a9e7293c1486600b007f210a9 Mon Sep 17 00:00:00 2001 From: Fenil Jikadara Date: Sat, 5 Apr 2025 12:15:30 +0530 Subject: [PATCH] Fix air gap installation: update image names, unify worker command, and add clamav service Signed-off-by: Fenil Jikadara --- Makefile | 2 +- docker-compose-offline.yml | 20 ++++++++++++++++---- docs/installation.rst | 4 ++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 2fbf02882..72a0dfd60 100644 --- a/Makefile +++ b/Makefile @@ -159,7 +159,7 @@ docker-images: @echo "-> Save the service images to a tar archive in the build/ directory" @rm -rf build/ @mkdir -p build/ - @docker save postgres redis scancodeio-worker scancodeio-web nginx | gzip > build/scancodeio-images.tar.gz + @docker save postgres redis scancodeio-worker scancodeio-web nginx clamav/clamav | gzip > build/scancodeio-images.tar.gz offline-package: docker-images @echo "-> Build package for offline installation in dist/" diff --git a/docker-compose-offline.yml b/docker-compose-offline.yml index 2bf7c96d3..d9f05b2ab 100644 --- a/docker-compose-offline.yml +++ b/docker-compose-offline.yml @@ -15,7 +15,7 @@ services: - redis_data:/data web: - image: scancodeio_web + image: scancodeio-web command: sh -c " ./manage.py migrate && ./manage.py collectstatic --no-input --verbosity 0 --clear && @@ -32,8 +32,12 @@ services: - db worker: - image: scancodeio_worker - command: wait-for-it web:8000 -- ./manage.py rqworker --worker-class scancodeio.worker.ScanCodeIOWorker --queue-class scancodeio.worker.ScanCodeIOQueue --verbosity 2 + image: scancodeio-worker + # Ensure that potential db migrations run first by waiting until "web" is up + command: wait-for-it --strict --timeout=120 web:8000 -- sh -c " + ./manage.py rqworker --worker-class scancodeio.worker.ScanCodeIOWorker + --queue-class scancodeio.worker.ScanCodeIOQueue + --verbosity 1" env_file: - docker.env volumes: @@ -42,7 +46,7 @@ services: depends_on: - redis - db - - web # Ensure that potential db migrations run first + - web nginx: image: nginx @@ -55,8 +59,16 @@ services: depends_on: - web + clamav: + image: clamav/clamav + volumes: + - clamav_data:/var/lib/clamav + - workspace:/var/scancodeio/workspace/ + restart: always + volumes: db_data: redis_data: + clamav_data: static: workspace: diff --git a/docs/installation.rst b/docs/installation.rst index 03d2bd402..3d5aade64 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -182,6 +182,10 @@ and scripts on your local machine:: A tarball ``scancodeio-offline-package-VERSION.tar`` will be created in the :guilabel:`dist/` directory. +.. note:: + The offline package includes all necessary Docker images: postgres, redis, + scancodeio-web, scancodeio-worker, nginx, and clamav/clamav. + Install on an offline server ^^^^^^^^^^^^^^^^^^^^^^^^^^^^