Skip to content

Commit 991e20c

Browse files
committed
docs: add Windows Docker installation instructions
Signed-off-by: Gunjan Sonawane <gunjansonawane462@gmail.com>
1 parent 8f9b6eb commit 991e20c

1 file changed

Lines changed: 58 additions & 3 deletions

File tree

docs/source/installation.rst

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,65 @@ to run on a different port than 8000.
9090
.. tip::
9191

9292
Set ``STAGING=False`` in ``.env`` file to disable the staging environment warning.
93+
Windows installation with Docker
94+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9395

96+
Windows users should run VulnerableCode with Docker Desktop. Native Windows
97+
installation is not supported.
98+
99+
Install and start Docker Desktop, then open PowerShell and clone the repository::
100+
101+
git clone https://github.com/aboutcode-org/vulnerablecode.git
102+
cd vulnerablecode
103+
104+
Create the configuration directory and environment file using PowerShell. The
105+
following commands generate secure values for both required settings::
106+
107+
New-Item -ItemType Directory -Force .\vulnerablecode-config
108+
$secretKeyBytes = New-Object byte[] 50
109+
$rng = [System.Security.Cryptography.RandomNumberGenerator]::Create()
110+
$rng.GetBytes($secretKeyBytes)
111+
$secretKey = [Convert]::ToBase64String($secretKeyBytes)
112+
113+
$altchaKeyBytes = New-Object byte[] 32
114+
$rng.GetBytes($altchaKeyBytes)
115+
$altchaHmacKey = -join ($altchaKeyBytes | ForEach-Object { $_.ToString("x2") })
116+
$rng.Dispose()
117+
118+
@"
119+
SECRET_KEY="$secretKey"
120+
ALTCHA_HMAC_KEY="$altchaHmacKey"
121+
"@ | Set-Content .\vulnerablecode-config\.env
122+
123+
Create ``docker-compose.override.yml`` with the configuration mount for the
124+
application, scheduler, and both RQ workers::
125+
126+
services:
127+
vulnerablecode:
128+
volumes:
129+
- .\vulnerablecode-config:/etc/vulnerablecode/
130+
vulnerablecode_scheduler:
131+
volumes:
132+
- .\vulnerablecode-config:/etc/vulnerablecode/
133+
vulnerablecode_rqworker:
134+
volumes:
135+
- .\vulnerablecode-config:/etc/vulnerablecode/
136+
vulnerablecode_rqworker_high:
137+
volumes:
138+
- .\vulnerablecode-config:/etc/vulnerablecode/
139+
140+
Start and check the services::
141+
142+
docker compose up -d
143+
docker compose ps
144+
145+
VulnerableCode should then be available at::
146+
147+
http://localhost
148+
149+
To stop the services::
150+
151+
docker compose down
94152

95153
.. _local_development_installation:
96154

@@ -105,9 +163,6 @@ Supported Platforms
105163
#. **Debian-based** Linux distributions
106164
#. **macOS** 12.1 and up
107165

108-
.. warning::
109-
On **Windows** VulnerableCode can **only** :ref:`run_with_docker` and is not supported.
110-
111166
Pre-installation Checklist
112167
^^^^^^^^^^^^^^^^^^^^^^^^^^
113168

0 commit comments

Comments
 (0)