-
-
Notifications
You must be signed in to change notification settings - Fork 243
Add docker docs #521
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
Merged
Merged
Add docker docs #521
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| .. _docker_image: | ||
|
|
||
| Docker image | ||
| ============ | ||
|
|
||
| Get Docker | ||
| ---------- | ||
|
|
||
| The first step is to download and install Docker on your platform. | ||
| Refer to the following Docker documentation and choose the best installation | ||
| path for you: `Get Docker <https://docs.docker.com/get-docker/>`_ | ||
|
|
||
| Build the Image | ||
| --------------- | ||
|
|
||
| VulnerableCode is distributed with ``Dockerfile`` and ``docker-compose.yml`` files | ||
| required for the creation of the Docker image. | ||
|
|
||
| Clone the git `VulnerableCode repo <https://github.com/nexB/vulnerablecode>`_, | ||
| create an environment file, and build the Docker image: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| git clone https://github.com/nexB/vulnerablecode.git && cd vulnerablecode | ||
| make envfile | ||
| docker-compose build | ||
|
|
||
| .. note:: | ||
|
|
||
| The image will need to be re-built when the VulnerableCode app source code is | ||
| modified or updated via | ||
| ``docker-compose build --no-cache vulnerablecode`` | ||
|
|
||
| Run the Image | ||
| ------------- | ||
|
|
||
| Run your image as a container | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| docker-compose up | ||
|
|
||
|
|
||
| At this point, the VulnerableCode app should be running at port ``8000`` on your Docker host. | ||
| Go to http://localhost:8000/ on a web browser to access the web UI. | ||
| Optionally, you can set ``NGINX_PORT`` environment variable in your shell or in the `.env` file to run on a different port than 8000. | ||
|
|
||
| .. note:: | ||
|
|
||
| To access a dockerized VulnerableCode app from a remote location, the ``ALLOWED_HOSTS`` | ||
Hritik14 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| setting need to be provided in your ``docker.env`` file:: | ||
|
|
||
| ALLOWED_HOSTS=.domain.com,127.0.0.1 | ||
|
|
||
| Refer to `Django ALLOWED_HOSTS settings <https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts>`_ | ||
| for documentation. | ||
|
|
||
| .. warning:: | ||
|
|
||
| Serving VulnerableCode on a network could lead to security issues and there | ||
| are several steps that may be needed to secure such a deployment. | ||
| Currently, this is not recommendend. | ||
|
|
||
|
|
||
| Invoke the importers | ||
| -------------------- | ||
|
|
||
| Connect to the Docker container ``bash``. | ||
| From here you can access ``manage.py`` and run management commands | ||
| to import data as specified in the `Data import <../README.rst#data-import>`_ section and run commands | ||
| for the importers from there | ||
|
|
||
| For example: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| docker-compose exec vulnerablecode bash | ||
| ./manage.py import --list | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.