DefectDojo / godojo

Golang installer for DefectDojo
GNU General Public License v3.0
23 stars 22 forks source link

How to persist DefectDojo installation with godojo #85

Open brunomcuesta opened 11 months ago

brunomcuesta commented 11 months ago

Hello! I installed DefectDojo with godojo from a DockerFile. The problem is that if I stop the container and then start it again, everything that was installed with godojo is lost. I'm using Podman Desktop. How can I persist the installation?

This is my DockerFile where I download an Ubuntu image and inside it I install DefectDojo with godojo.

# Download Ubuntu 22.04
FROM ubuntu:22.04

# Update and install packages
RUN apt update
RUN apt install wget unzip build-essential net-tools gawk bison screen systemd nano iputils-ping curl -y

# Downloading and unpacking godojo installer
WORKDIR /opt
RUN wget -c https://github.com/DefectDojo/godojo/releases/download/1.2.1/godojo-v1.2.1_standard.zip -O godojo-v1.2.1_standard.zip
RUN unzip godojo-v1.2.1_standard.zip

# Download scripts to start and stop defectdojo
# https://github.com/DefectDojo/godojo/tree/master/docs-and-scripts
WORKDIR /opt/standard
RUN wget -c https://raw.githubusercontent.com/DefectDojo/godojo/master/docs-and-scripts/dojo-start
RUN wget -c https://raw.githubusercontent.com/DefectDojo/godojo/master/docs-and-scripts/dojo-stop

# Giving permission to run
RUN chmod +x dojo-start
RUN chmod +x dojo-stop
RUN chmod +x godojo

# Copy env.prod file to image
COPY env.prod /opt/dojo/django-DefectDojo/dojo/settings/.env.prod

# Running godojo installer to generate a default dojoConfig.yml file
RUN ./godojo

Thanks!