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

Users who have contributed to this file

@alles-klar @hendrikhalkow @millaguie @aaronweaver
73 lines (65 sloc) 2.02 KB
# code: language=Dockerfile
# The code for the build image should be idendical with the code in
# Dockerfile.django to use the caching mechanism of Docker.
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 build AS collectstatic
USER root
RUN \
apt-get -y update && \
apt-get -y install apt-transport-https ca-certificates && \
curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
echo "deb https://deb.nodesource.com/node_11.x stretch main" | tee /etc/apt/sources.list.d/nodesource.list && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get -y update && \
apt-get -y install nodejs && \
apt-get -y install --no-install-recommends yarn && \
apt-get clean && \
rm -rf /var/lib/apt/lists && \
true
RUN pip3 install \
--no-cache-dir \
--no-index \
--find-links=/tmp/wheels \
-r ./requirements.txt
COPY components/ ./components/
COPY manage.py ./
COPY dojo/ ./dojo/
RUN \
cp dojo/settings/settings.dist.py dojo/settings/settings.py
RUN \
cd components && \
yarn && \
cd .. && \
python3 manage.py collectstatic --noinput && \
true
FROM nginx:1.17.2@sha256:eb3320e2f9ca409b7c0aa71aea3cf7ce7d018f03a372564dbdb023646958770b
COPY --from=collectstatic /app/static/ /usr/share/nginx/html/static/
COPY wsgi_params nginx/nginx.conf /etc/nginx/
COPY docker/entrypoint-nginx.sh /
RUN \
chmod -R g=u /var/cache/nginx && \
chmod -R g=u /var/run && \
true
ENV \
DD_UWSGI_PASS="uwsgi_server" \
DD_UWSGI_HOST="uwsgi" \
DD_UWSGI_PORT="3031"
USER 1001
EXPOSE 8080
ENTRYPOINT ["/entrypoint-nginx.sh"]
You can’t perform that action at this time.