Search code examples
dockerowasp-dependency-track

CORS issue with Dependency Track Containers


I need help solving a CORS issue.

I am trying to run dependency track using Docker.

I have pulled the docker-compose file following the instructions here

I have modified the configuration file to use my local IP address instead of localhost: for the API_BASE_URL.

My entry looks like - API_BASE_URL=http://XXX.XXX.XX.XX:8081

I have uncommented the alpine CORS settings (in case this was the issue) but am still getting a CORS error:

Access to XMLHttpRequest at 'http://XXX.XXX.X.XXX:8081/api/version' from origin 'http://XXX.XXX.X.XXX:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

The system works over two containers. One container for the front end. One container for the API. The communication between the two containers is throwing the CORS error.

The configuration file description is here


Solution

  • The issue was that the system had an error that was shown when running not in detached mode. The container required more cores.

    You can either add more cores OR add the following environment variable to ignore the error.

    I missed this message in the documentation:

    These requirements can be disabled by setting the ‘system.requirement.check.enabled’ property or the ‘SYSTEM_REQUIREMENT_CHECK_ENABLED’ environment variable to ‘false’.