scancode.io icon indicating copy to clipboard operation
scancode.io copied to clipboard

Update docker-compose.yml

Open JonoYang opened this issue 10 months ago • 1 comments

This PR add a new service in the docker-compose.yml files to run the purldb-scan-queue-worker command.

JonoYang avatar Mar 27 '24 19:03 JonoYang

@tdruez I've reverted the docker-compose files I modified and created a new docker-compose.purldb-scan-queue-worker.yml for this.

JonoYang avatar Mar 28 '24 19:03 JonoYang

@JonoYang There must be a better way than duplicating the whole compose file for a few line additions. Also, this is likely to be out of sync each time we make changes to the original compose file.

Can't we use the "merge", "extend", "include", features of compose? https://docs.docker.com/compose/multiple-compose-files/

What about a simpler filename docker-compose.purldb-queue.yml file including the docker-compose.yml file, such as:

version: "3"

include:
  - docker-compose.yml

services:
  purldb_scan_queue_worker:
    build: .
    command: wait-for-it --strict --timeout=120 web:8000 -- sh -c "
        ./manage.py purldb-scan-queue-worker --async --sleep 3"
    env_file:
      - docker.env
    volumes:
      - .env:/opt/scancodeio/.env
      - /etc/scancodeio/:/etc/scancodeio/
      - workspace:/var/scancodeio/workspace/
    depends_on:
      - db
      - web

tdruez avatar Apr 17 '24 10:04 tdruez

@tdruez I've renamed the purldb-scan-queue-worker management command to purldb-scan-worker and updated docker-compose.purldb-scan-worker.yml with the changes you suggested.

JonoYang avatar Apr 17 '24 21:04 JonoYang