Scanning from a requirements file works as expected, you just need to make sure to volume mount your project so that Safety can access it inside the container:
You can also scan from stdin; this allows you to generate the list of dependencies outside the Docker container, while Safety runs within it. This is most useful when you're running an older version of Python for your application (eg, Python 2.7):
Lastly, you can pass in an environment for Safety to scan. This can be a bit tricky, as you'll need to pass in the site-packages folder, and set the PYTHONPATH to ensure Safety scans it correctly. The following example is for a local virtualenv: