Skip to content

Commit ce3b78d

Browse files
DOCKER.md: use docker compose everywhere (#12014)
* DOCKER.md: use docker compose everywhere * DOCKER.md: use docker compose everywhere * more docker compose * morrrrrrrre compose
1 parent bcca5a0 commit ce3b78d

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

readme-docs/DOCKER.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The docker-compose.yml file in this repository is fully functional to evaluate DefectDojo in your local environment.
44

5-
Although Docker Compose is one of the supported installation methods to deploy a containerized DefectDojo in a production environment, the docker-compose.yml file is not intended for production use without first customizing it to your particular situation.
5+
Although Docker Compose is one of the supported installation methods to deploy a containerized DefectDojo in a production environment, the docker-compose.yml file is not intended for production use without first customizing it to your particular situation.
66

77
[Running in Production](https://docs.defectdojo.com/en/open_source/installation/running-in-production/) gives advice on which adjustments are useful for performance and operational reliability.
88

@@ -144,10 +144,9 @@ Make sure you write down the first password generated as you'll need it when re-
144144
## Option to change the password
145145
* If you dont have admin password use the below command to change the password.
146146
* After starting the container and open another tab in the same folder.
147-
* django-defectdojo-uwsgi-1 -- name obtained from running containers using ```zsh docker ps ``` command
148147

149148
```zsh
150-
docker exec -it django-defectdojo-uwsgi-1 ./manage.py changepassword admin
149+
docker compose exec -it uwsgi ./manage.py changepassword admin
151150
```
152151

153152
# Logging
@@ -189,20 +188,35 @@ Building will tag the images with "x.y.z", then you can run the application base
189188
* Tagged images can be seen with:
190189

191190
```
191+
$ docker compose images
192+
CONTAINER REPOSITORY TAG IMAGE ID SIZE
193+
dd-nginx-1 defectdojo/defectdojo-nginx latest b0a5f30ab01a 193MB
194+
...
195+
196+
or
197+
192198
$ docker images
193199
REPOSITORY TAG IMAGE ID CREATED SIZE
194200
defectdojo/defectdojo-nginx 1.0.0 bc9c5f7bb4e5 About an hour ago 191MB
201+
...
195202
```
196203

197204
* This will show on which tagged images the containers are running:
198205

199206
```
207+
$ docker compose ps
208+
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
209+
dd-nginx-1 defectdojo/defectdojo-nginx:latest "/entrypoint-nginx.sh" nginx About a minute ago Up About a minute 0.0.0.0:8080->8080/tcp, [::]:8080->8080/tcp,
210+
...
211+
212+
or
213+
200214
$ docker ps
201215
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
202216
aedc404d6dee defectdojo/defectdojo-nginx:1.0.0 "/entrypoint-nginx.sh" 2 minutes ago Up 2 minutes 80/tcp, 0.0.0.0:8080->8080/tcp django-defectdojo_nginx_1
217+
...
203218
```
204219

205-
206220
## Clean up Docker Compose
207221

208222
Removes all containers
@@ -231,7 +245,7 @@ To secure the application by https, follow those steps
231245
ssl_certificate /etc/nginx/ssl/nginx.crt
232246
ssl_certificate_key /etc/nginx/ssl/nginx.key;
233247
```
234-
*set the GENERATE_TLS_CERTIFICATE != True in the docker-compose.override.https.yml
248+
*set the GENERATE_TLS_CERTIFICATE != True in the docker-compose.override.https.yml
235249
* Protect your private key from other users:
236250
```
237251
chmod 400 nginx/*.key
@@ -286,12 +300,11 @@ If you want to enter the container to run more tests or a single test case, leav
286300
docker/setEnv.sh dev
287301
docker compose up
288302
```
289-
Then
303+
Then
290304
```
291-
docker ps
292-
#find the name of the uwsgi container from the above command
293-
docker exec -ti [container-name] bash
305+
docker exec -it uwsgi /bin/bash
294306
```
307+
You're now inside the container.
295308
Rerun all the tests:
296309

297310
```
@@ -310,7 +323,7 @@ Run a single test. Example:
310323
python manage.py test unittests.tools.test_dependency_check_parser.TestDependencyCheckParser.test_parse_file_with_no_vulnerabilities_has_no_findings --keepdb
311324
```
312325

313-
For docker compose stack, there is a convenience script (`run-unittest.sh`) capable of running a single test class.
326+
For docker compose stack, there is a convenience script (`run-unittest.sh`) capable of running a single test class.
314327
You will need to provide a test case (`--test-case`). Example:
315328

316329
```
@@ -329,7 +342,7 @@ NB: the first time you run it, initializing the database may be too long for the
329342

330343
Check the logs with:
331344
```
332-
docker logs -f django-defectdojo_integration-tests_1
345+
docker compose logs -f integration-tests
333346
```
334347

335348
# Checking Docker versions

0 commit comments

Comments
 (0)