forked from DefectDojo/django-DefectDojo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
28 lines (23 loc) · 1.28 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM ubuntu:16.04
MAINTAINER Matt Tesauro <[email protected]>
# Create a single Docker running DefectDojo and all dependencies
ADD . /opt/django-DefectDojo
RUN apt update \
&& DEBIAN_FRONTEND=noninteractive apt install -y mysql-server sudo git expect wget \
&& usermod -d /var/lib/mysql/ mysql \
&& service mysql start \
&& cd /opt \
&& export AUTO_DOCKER=yes \
&& /opt/django-DefectDojo/setup.bash \
&& cd /tmp \
&& wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz \
&& tar xvfJ wkhtmltox-0.12.4_linux-generic-amd64.tar.xz \
&& sudo chown root:root wkhtmltox/bin/wkhtmltopdf \
&& sudo cp wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf \
&& service mysql stop
WORKDIR /opt/django-DefectDojo
ENTRYPOINT chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \
&& service mysql start \
&& su - dojo -c "cd /opt/django-DefectDojo && celery -A dojo worker -l info --concurrency 3 >> /opt/django-DefectDojo/worker.log 2>&1 &" \
&& su - dojo -c "cd /opt/django-DefectDojo && celery beat -A dojo -l info >> /opt/django-DefectDojo/beat.log 2>&1 &" \
&& su - dojo -c "cd /opt/django-DefectDojo && python manage.py runserver 0.0.0.0:8000 >> /opt/django-DefectDojo/dojo.log 2>&1"