From 8f1fa6ae2e4bfb296b4d009055011dcfda34981d Mon Sep 17 00:00:00 2001 From: Hritik Vijay Date: Sun, 18 Jul 2021 07:01:46 +0530 Subject: [PATCH] Add Docker related documentation 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 --- README.rst | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/README.rst b/README.rst index 8fc45abd3..d35028e46 100644 --- a/README.rst +++ b/README.rst @@ -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 `__ -- Docker Compose. Find instructions to install it - `here `__ - -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 `__ Without Docker Compose ~~~~~~~~~~~~~~~~~~~~~~ @@ -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 ~~~~~~~~~ @@ -213,6 +196,8 @@ Use these commands to run code style checks and the test suite:: python -m pytest +.. _Data import: + Data import -----------