Skip to content

Commit b36f03b

Browse files
authored
Entrypoint fix for docker (DefectDojo#1041)
* fix#982 * update * Handle Burp Collaborator issues This is an enhancement in order to handle findings that contain Burp collaborator interactions which have additional request/response pairs and additional information that was normally ignored or breaking the importing of the report . * Fix flake8 errors * More accessibility fixes for top and side menu * Made search button accessible * tune uwsgi read timeout (troubleshoots 'upstream timed out' on POST import_scan_results) * add a different docker-compose for dev and for release * add a different docker-compose for dev and for release * Update README.md * cicd engagement: after delete return to cicd engagement view * Updated DOCKER.md in dev branch to include info on checking versions for docker and docker-compose. People are getting tripped up by installs that aren't up to date * Docker readme update * Travis compose sourcing script * Github template DB addition, docker sourcing
1 parent 0380a90 commit b36f03b

18 files changed

+145
-55
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Bug report
33
about: Create a report to help us improve
44
title: ''
5-
labels: ''
5+
labels: 'bug'
66
assignees: ''
77

88
---

.github/ISSUE_TEMPLATE/security_issue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Security issue
33
about: Report a security issue
44
title: Please submit via our security reporting program, not GitHub
5-
labels: ''
5+
labels: 'security'
66
assignees: ''
77

88
---

DOCKER.md

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,23 @@ use the [Helm and Kubernetes](KUBERNETES.md) approach.
66

77
## Setup via Docker Compose
88

9-
If you start your DefectDojo instance on Docker Compose for the first time, just
10-
run `docker-compose up`.
9+
To start your DefectDojo instance on Docker Compose for the first time, just
10+
run:
11+
12+
```zsh
13+
. docker/aliases_release.sh
14+
docker-compose up
15+
```
16+
17+
or
18+
19+
```zsh
20+
docker-compose -f docker-compose_base.yml -f docker-compose_uwsgi-release.yml up
21+
```
22+
23+
This command will run the application based on images commited on dockerhub (or the last images built locally). If you need to be more up to date, see "Build images locally" below
24+
25+
**NOTE:** Installing with docker-compose requires the latest version of docker and docker-compose - at least docker 18.09.4 and docker-compose 1.24.0. See "Checking Docker versions" below for version errors during running docker-compose up.
1126

1227
**NOTE:** Installing with docker-compose requires the latest version of docker and docker-compose - at least docker 18.09.4 and docker-compose 1.24.0. See "Checking Docker versions" below for version errors during running docker-compose up.
1328

@@ -22,17 +37,34 @@ container_id=(`docker ps -a \
2237
docker logs $container_id 2>&1 | grep "Admin password:"
2338
```
2439

40+
or:
41+
42+
```zsh
43+
docker logs django-defectdojo_initializer_1
44+
```
45+
2546
If you ran DefectDojo with compose before and you want to prevent the
2647
initializer container from running again, define an environment variable
27-
`DD_INITIALIZE=false` to prevent re-initialization.
48+
DD_INITIALIZE=false to prevent re-initialization.
2849

2950
### Develop with Docker Compose
3051

31-
For developing the easiset way to make changes is to startup DefectDojo in debug by running `docker-compose -f docker-compose.yml up`. This starts the DefectDojo (uwsgi) container with manage.py and shares the local source directory so that changes to the code immediately restart the process.
52+
For developing the easiset way to make changes is to startup DefectDojo in debug by running:
3253

33-
Navigate to the container directly, <http://localhost:8000>
54+
```zsh
55+
. docker/aliases_dev.sh
56+
docker-compose up
57+
```
58+
59+
or
60+
61+
```zsh
62+
docker-compose -f docker-compose_base.yml -f docker-compose_uwsgi-dev.yml up
63+
```
64+
65+
This starts the DefectDojo (uwsgi) container with manage.py and shares the local source directory so that changes to the code immediately restart the process.
3466

35-
Build the containers locally: `docker-compose build`
67+
Navigate to the container directly, <http://localhost:8000>
3668

3769
The initializer container can be disabled by exporting: `export DD_INITIALIZE=false`
3870

@@ -41,14 +73,19 @@ The initializer container can be disabled by exporting: `export DD_INITIALIZE=fa
4173
Build the docker containers locally for testing purposes.
4274

4375
```zsh
76+
# Build Dev Compose
77+
docker-compose build
78+
79+
or:
80+
4481
# Build images
4582
docker build -t defectdojo/defectdojo-django -f Dockerfile.django .
4683
docker build -t defectdojo/defectdojo-nginx -f Dockerfile.nginx .
4784
```
4885

4986
### Clean up Docker Compose
5087

51-
Removes all containers
88+
Removes all containers
5289

5390
```zsh
5491
docker-compose down

PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ When submitting a pull request, please make sure you have completed the followin
44

55
- [ ] Your code is flake8 compliant (DefectDojo's code isn't currently flake8 compliant, but we're trying to correct that.)
66
- [ ] If this is a new feature and not a bug fix, you've included the proper documentation in the ReadTheDocs documentation folder. https://github.com/DefectDojo/Documentation/tree/master/docs or provide feature documentation in the PR.
7+
- [ ] Model changes should include the necessary migrations in the dojo/dd_migrations folder.
78
- [ ] Add applicable tests to the unit tests.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ DefectDojo is maintained by:
9898
Project Moderators can help you with pull requests or feedback on dev ideas.
9999

100100
* [Alex Dracea](https://www.linkedin.com/in/alexandru-marin-dracea-910b51122/)
101+
* [Valentijn Scholten](https://www.linkedin.com/in/valentijn-scholten/)
101102

102103
## Hall of Fame
103104

docker-compose.yml renamed to docker-compose_base.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,6 @@ services:
1010
published: ${DD_PORT:-8080}
1111
protocol: tcp
1212
mode: host
13-
uwsgi:
14-
image: defectdojo/defectdojo-django:latest
15-
build:
16-
context: ./
17-
dockerfile: Dockerfile.django
18-
depends_on:
19-
- mysql
20-
entrypoint: ['/wait-for-it.sh', 'mysql:3306', '-t', '30', '--', '/entrypoint-uwsgi-dev.sh']
21-
volumes:
22-
- '.:/app'
23-
ports:
24-
- 8000:8000
25-
environment:
26-
DD_DEBUG: 'on'
27-
DD_ALLOWED_HOSTS: ${DD_ALLOWED_HOSTS:-*}
28-
DD_DATABASE_URL: ${DD_DATABASE_URL:-mysql://defectdojo:defectdojo@mysql:3306/defectdojo}
29-
DD_CELERY_BROKER_USER: ${DD_CELERY_BROKER_USER:-guest}
30-
DD_CELERY_BROKER_PASSWORD: ${DD_CELERY_BROKER_USER:-guest}
3113
celerybeat:
3214
image: defectdojo/defectdojo-django:latest
3315
depends_on:
@@ -62,8 +44,6 @@ services:
6244
DD_INITIALIZE: ${DD_INITIALIZE:-true}
6345
mysql:
6446
image: mysql:5.7
65-
volumes:
66-
- defectdojo_data:/var/lib/mysql
6747
environment:
6848
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
6949
DD_DATABASE_URL: ${DD_DATABASE_URL:-mysql://defectdojo:defectdojo@mysql:3306/defectdojo}
@@ -73,5 +53,3 @@ services:
7353
command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
7454
rabbitmq:
7555
image: rabbitmq:3.7
76-
volumes:
77-
defectdojo_data: {}

docker-compose_uwsgi-dev.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
version: '3.7'
3+
services:
4+
uwsgi:
5+
build:
6+
context: ./
7+
dockerfile: Dockerfile.django
8+
depends_on:
9+
- mysql
10+
entrypoint: ['/wait-for-it.sh', 'mysql:3306', '-t', '30', '--', '/entrypoint-uwsgi-dev.sh']
11+
volumes:
12+
- '.:/app'
13+
ports:
14+
- 8000:8000
15+
environment:
16+
DD_DEBUG: 'on'
17+
DD_ALLOWED_HOSTS: ${DD_ALLOWED_HOSTS:-*}
18+
DD_DATABASE_URL: ${DD_DATABASE_URL:-mysql://defectdojo:defectdojo@mysql:3306/defectdojo}
19+
DD_CELERY_BROKER_USER: ${DD_CELERY_BROKER_USER:-guest}
20+
DD_CELERY_BROKER_PASSWORD: ${DD_CELERY_BROKER_USER:-guest}

docker-compose.override.yml renamed to docker-compose_uwsgi-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ services:
77
- mysql
88
entrypoint: ['/wait-for-it.sh', 'mysql:3306', '-t', '30', '--', '/entrypoint-uwsgi.sh']
99
environment:
10-
DD_DEBUG: 'on'
10+
DD_DEBUG: 'off'
1111
DD_ALLOWED_HOSTS: ${DD_ALLOWED_HOSTS:-*}
1212
DD_DATABASE_URL: ${DD_DATABASE_URL:-mysql://defectdojo:defectdojo@mysql:3306/defectdojo}
1313
DD_CELERY_BROKER_USER: ${DD_CELERY_BROKER_USER:-guest}
14-
DD_CELERY_BROKER_PASSWORD: ${DD_CELERY_BROKER_USER:-guest}
14+
DD_CELERY_BROKER_PASSWORD: ${DD_CELERY_BROKER_USER:-guest}

docker/aliases_dev.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
alias docker-compose='docker-compose -f docker-compose_base.yml -f docker-compose_uwsgi-dev.yml'

docker/aliases_release.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
alias docker-compose='docker-compose -f docker-compose_base.yml -f docker-compose_uwsgi-release.yml'

0 commit comments

Comments
 (0)