Skip to content

Commit

Permalink
Add Docker related documentation
Browse files Browse the repository at this point in the history
This calls for a lot of changes in other parts of documentation as well.
This will be done in later PRs. This commit marks the end of this PR.

Signed-off-by: Hritik Vijay <[email protected]>
  • Loading branch information
Hritik14 committed Jul 28, 2021
1 parent 25292dd commit 1ab0b28
Showing 1 changed file with 9 additions and 24 deletions.
33 changes: 9 additions & 24 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,29 +90,10 @@ First clone the source code::
cd vulnerablecode




Using Docker Compose
~~~~~~~~~~~~~~~~~~~~

An easy way to set up VulnerableCode is with docker containers and docker
compose. For this you need to have the following installed.

- Docker Engine. Find instructions to install it
`here <https://docs.docker.com/get-docker/>`__
- Docker Compose. Find instructions to install it
`here <https://docs.docker.com/compose/install/#install-compose>`__

Use ``sudo docker-compose up`` to start VulnerableCode. Then access
VulnerableCode at http://localhost:8000/ or at http://127.0.0.1:8000/

**Important**: Don't forget to run ``sudo docker-compose up -d --no-deps --build vulnerablecode`` to sync your instance after every ``git pull``.


Use ``sudo docker-compose exec vulnerablecode bash`` to access the VulnerableCode
container. From here you can access ``manage.py`` and run management commands
to import data as specified below.
---------------------

Please find the docker documentation in `Docker Installation <docs/docker_installation.rst>`__

Without Docker Compose
~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -159,11 +140,13 @@ for this purpose::

SECRET_KEY=$(python -c "from django.core.management import utils; print(utils.get_random_secret_key())")

You will also need to setup the VC_ALLOWED_HOSTS environment variable to match the hostname where the app is deployed::
You will also need to setup the `ALLOWED_HOSTS` array inside `vulnerablecode/settings.py` according to
[django specifications](https://docs.djangoproject.com/en/3.2/ref/settings/#allowed-hosts). One example would be:
.. code-block:: python
VC_ALLOWED_HOSTS=vulnerablecode.your.domain.example.com
ALLOWED_HOSTS = ['vulnerablecode.your.domain.example.com']
You can specify several host by separating them with a colon `:`
You can specify several hosts by separating them with a comma (`,`)

Using Nix
~~~~~~~~~
Expand Down Expand Up @@ -213,6 +196,8 @@ Use these commands to run code style checks and the test suite::
python -m pytest


.. _Data import:

Data import
-----------

Expand Down

0 comments on commit 1ab0b28

Please sign in to comment.