Skip to content

Commit 1f2a4b7

Browse files
authored
Updated commands and added clarity to specific question.s
1 parent 7879fc0 commit 1f2a4b7

File tree

1 file changed

+31
-15
lines changed

1 file changed

+31
-15
lines changed

DOCKER.md

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Running with Docker Compose
22

3-
Docker compose is not intended for production use.
4-
If you want to deploy a containerized DefectDojo to a production environment,
5-
use the [Default installation](setup/README.md) approach.
3+
The docker-compose.yml in this repo is not intended for production use without first customizing it to fit your specific situation. Please consider the docker-compose.yml files are templates to create on that fits your needs.
4+
Docker Compose is acceptable if you want to deploy a containerized DefectDojo to a production environment.
5+
It is one of the supported [Default installation](setup/README.md) methods.
66

77
# Prerequisites
88
* Docker version
@@ -114,7 +114,7 @@ docker-compose up
114114

115115
This will run the application based on merged configurations from docker-compose.yml and docker-compose.override.ptvsd.yml.
116116

117-
The default configuration assumes port 3000 by default for ptvsd, and you should access the DefectDojo UI on port 8000 instead of port 8080, as the uwsgi container will serve directly.
117+
The default configuration assumes port 3000 by default for ptvsd.
118118

119119
### VS code
120120
Add the following python debug configuration (You would have to install the `ms-python.python`. Other setup may work.)
@@ -198,26 +198,33 @@ docker-compose down --volumes
198198
```
199199

200200
# Run with docker using https
201+
## use your own Credentials
201202
To secure the application by https, follow those steps
202203
* Generate a private key without password
203204
* Generate a CSR (Certificate Signing Request)
204205
* Have the CSR signed by a certificate authority
205206
* Place the private key and the certificate under the nginx folder
206-
* Replace nginx/nginx.conf by nginx/nginx_TLS.conf
207-
* In nginx.conf, update that part:
207+
* copy your secrets into:
208208
```
209209
server_name your.servername.com;
210-
ssl_certificate /yourCertificate.cer;
211-
ssl_certificate_key /yourPrivateKey.key;
210+
ssl_certificate /etc/nginx/ssl/nginx.crt
211+
ssl_certificate_key /etc/nginx/ssl/nginx.key;
212212
```
213+
*set the GENERATE_TLS_CERTIFICATE != True in the docker-compose.override.https.yml
213214
* Protect your private key from other users:
214215
```
215216
chmod 400 nginx/*.key
216217
```
217-
* Rebuild the nginx image in order to place the private key and the certificate where nginx will find them (under / in the nginx container):
218218

219-
```docker build -t defectdojo/defectdojo-nginx -f Dockerfile.nginx .```
219+
* Run defectDojo with:
220+
```
221+
rm -f docker-compose.override.yml
222+
ln -s docker-compose.override.https.yml docker-compose.override.yml
223+
docker-compose up
224+
```
220225

226+
## create Credentials on the fly
227+
* you can generate a Certificate on the fly (without valid domainname etc.)
221228

222229
* Run defectDojo with:
223230
```
@@ -226,7 +233,7 @@ ln -s docker-compose.override.https.yml docker-compose.override.yml
226233
docker-compose up
227234
```
228235

229-
The default https port is 8083.
236+
The default https port is 8443.
230237

231238
To change the port:
232239
- update `nginx.conf`
@@ -236,14 +243,14 @@ To change the port:
236243
NB: some third party software may require to change the exposed port in Dockerfile.nginx as they use docker-compose declarations to discover which ports to map when publishing the application.
237244

238245

239-
# Run the unit-tests with docker
240-
## Introduction
246+
# Run the tests with docker
241247
The unit-tests are under `dojo/unittests`
242248

249+
The integration-tests are under `tests`
243250

244251

245-
## Running the unit-tests
246-
This will run all the tests and leave the uwsgi container up:
252+
## Running the unit-tests
253+
This will run all unit-tests and leave the uwsgi container up:
247254

248255
```
249256
cp dojo/settings/settings.dist.py dojo/settings/settings.py
@@ -273,6 +280,15 @@ Run a single test. Example:
273280
python manage.py test dojo.unittests.test_dependency_check_parser.TestDependencyCheckParser.test_parse_without_file_has_no_findings --keepdb
274281
```
275282

283+
## Running the integration-tests
284+
This will run all integration-tests and leave the containers up:
285+
286+
```
287+
cp dojo/settings/settings.dist.py dojo/settings/settings.py
288+
docker/setEnv.sh integration_tests
289+
docker-compose up
290+
```
291+
276292
# Checking Docker versions
277293

278294
Run the following to determine the versions for docker and docker-compose:

0 commit comments

Comments
 (0)