Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docker-compose.yml #1133

Merged
merged 3 commits into from
Apr 18, 2024
Merged

Update docker-compose.yml #1133

merged 3 commits into from
Apr 18, 2024

Conversation

JonoYang
Copy link
Contributor

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

@JonoYang JonoYang requested a review from tdruez March 27, 2024 21:13
Copy link
Member

@tdruez tdruez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to add a service, in the main compose config file, that is only required for a very specific use-case.
I would suggest to have a new compose file dedicated to this.
https://docs.docker.com/compose/multiple-compose-files/

@JonoYang
Copy link
Contributor Author

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

@tdruez
Copy link
Member

tdruez commented Apr 17, 2024

@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

    * Add new service for package-scan-worker

Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
    * Update docker-compose for purldb scan worker to include docker-compose.yml, rather than copy the contents
    * Update CHANGELOG.rst

Signed-off-by: Jono Yang <jyang@nexb.com>
@JonoYang
Copy link
Contributor Author

@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.

@tdruez tdruez merged commit 7d413bc into main Apr 18, 2024
9 checks passed
@tdruez tdruez deleted the update-docker-compose branch April 18, 2024 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants