# Build image with:
# docker build -t django-docs docs
#
# Build for example HTML documentation with:
# mkdir -p docs/_build && chmod g+s,o+wt docs/_build && docker run --rm -ti --security-opt=label:disable -v $PWD/docs:/django-docs:ro -v $PWD/docs/_build:/django-docs/_build django-docs html

FROM fedora
# The python-sphinx in Fedora 23 is older than what Django master expects
# RUN dnf install -y make python-sphinx && dnf clean all
RUN dnf install -y make python-pip && dnf clean all
RUN pip install sphinx
RUN ( echo '#!/bin/bash' ; echo 'umask 0002 ; make -C /django-docs "$@"' ) > /bin/django-makedocs
RUN chmod a+x /bin/django-makedocs
ENV PYTHONDONTWRITEBYTECODE 1
USER nobody
ENTRYPOINT [ "/bin/django-makedocs" ]
