Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
6 contributors

Users who have contributed to this file

@aaronweaver @alles-klar @hendrikhalkow @ptrovatelli @devGregA @madchap
110 lines (105 sloc) 3.26 KB
# code: language=Dockerfile
# The code for the build image should be idendical with the code in
# Dockerfile.nginx to use the caching mechanism of Docker.
# Using 3.5.7 to avoid compatibility issues that may be introduced by python 3.5.6 and 3.5.7.
# Please upgrade before end-of-life in september 2020!
# Ref: https://devguide.python.org/#branchstatus
FROM python:3.5.7-buster@sha256:4598d4365bb7a8628ba840f87406323e699c4da01ae6f926ff33787c63230779 as build
WORKDIR /app
RUN \
apt-get -y update && \
apt-get -y install \
dnsutils \
default-mysql-client \
postgresql-client \
xmlsec1 \
git \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists && \
true
COPY requirements.txt ./
RUN pip3 wheel --wheel-dir=/tmp/wheels -r ./requirements.txt
FROM python:3.5.7-slim-buster@sha256:127fee645393d311c7fbc5e8c2e5034f10a4e66b47c9273d4dbe5da2926fc3f2
WORKDIR /app
RUN \
apt-get -y update && \
# ugly fix to install postgresql-client without errors
mkdir -p /usr/share/man/man1 /usr/share/man/man7 && \
apt-get -y install --no-install-recommends \
# libopenjp2-7 libjpeg62 libtiff5 are required by the pillow package
libopenjp2-7 \
libjpeg62 \
libtiff5 \
dnsutils \
default-mysql-client \
libmariadb3 \
xmlsec1 \
git \
# only required for the dbshell (used by the initializer job)
postgresql-client \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists && \
true
RUN pip3 install --no-cache-dir --upgrade pip
COPY --from=build /tmp/wheels /tmp/wheels
COPY requirements.txt ./
RUN pip3 install \
--no-cache-dir \
--no-index \
--find-links=/tmp/wheels \
-r ./requirements.txt
COPY \
docker/entrypoint-celery-beat.sh \
docker/entrypoint-celery-worker.sh \
docker/entrypoint-initializer.sh \
docker/entrypoint-uwsgi.sh \
docker/entrypoint-uwsgi-dev.sh \
docker/entrypoint-unit-tests.sh \
docker/entrypoint-unit-tests-devDocker.sh \
docker/wait-for-it.sh \
/
COPY wsgi.py manage.py tests/unit-tests.sh ./
COPY dojo/ ./dojo/
# Legacy installs need the modified settings.py, do not remove!
RUN \
cp dojo/settings/settings.dist.py dojo/settings/settings.py
COPY tests/ ./tests/
RUN \
mkdir dojo/migrations && \
chmod g=u dojo/migrations && \
chmod g=u /var/run && \
true
USER root
RUN chmod 0777 /app
USER 1001
ENV \
DD_ADMIN_USER=admin \
DD_ADMIN_MAIL=admin@defectdojo.local \
DD_ADMIN_PASSWORD='' \
DD_ADMIN_FIRST_NAME=Administrator \
DD_ADMIN_LAST_NAME=User \
DD_ALLOWED_HOSTS="*" \
DD_CELERY_BEAT_SCHEDULE_FILENAME="/run/celery-beat-schedule" \
DD_CELERY_BROKER_SCHEME="amqp" \
DD_CELERY_BROKER_USER="defectdojo" \
DD_CELERY_BROKER_PASSWORD="defectdojo" \
DD_CELERY_BROKER_HOST="rabbitmq" \
DD_CELERY_BROKER_PORT="5672" \
DD_CELERY_BROKER_PATH="//" \
DD_CELERY_LOG_LEVEL="INFO" \
DD_DATABASE_ENGINE="django.db.backends.mysql" \
DD_DATABASE_HOST="mysql" \
DD_DATABASE_NAME="defectdojo" \
DD_DATABASE_PASSWORD="defectdojo" \
DD_DATABASE_PORT="3306" \
DD_DATABASE_USER="defectdojo" \
DD_SECRET_KEY="hhZCp@D28z!n@NED*yB!ROMt+WzsY*iq" \
DD_CREDENTIAL_AES_256_KEY="&91a*agLqesc*0DJ+2*bAbsUZfR*4nLw" \
DD_INITIALIZE=true \
DD_UWSGI_MODE="socket" \
DD_UWSGI_ENDPOINT="0.0.0.0:3031" \
DD_DJANGO_ADMIN_ENABLED="on" \
DD_TRACK_MIGRATIONS="on"
ENTRYPOINT ["/entrypoint-uwsgi.sh"]
You can’t perform that action at this time.