diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3e105ee --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM ubuntu:bionic + +RUN mkdir -p /opt/django + +WORKDIR /opt/django + +COPY . /opt/django + +## for apt to be noninteractive +ENV DEBIAN_FRONTEND noninteractive +ENV DEBCONF_NONINTERACTIVE_SEEN true + +## preesed tzdata, update package index, upgrade packages and install needed software +RUN echo "tzdata tzdata/Areas select Europe" > /tmp/preseed.txt; \ + echo "tzdata tzdata/Zones/Europe select Berlin" >> /tmp/preseed.txt; \ + debconf-set-selections /tmp/preseed.txt && \ + rm /etc/timezone | true && \ + rm /etc/localtime | true && \ + apt-get update && \ + apt-get install -y tzdata texlive-latex-extra + +RUN apt-get install -y python-pip + +## cleanup of files from setup +RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN pip install -r requirements.txt + + +CMD make latexpdf && make epub diff --git a/README.rst b/README.rst index dd15102..bb6e207 100644 --- a/README.rst +++ b/README.rst @@ -18,6 +18,13 @@ Compiling the source make latexpdf make epub +You can compile with Docker instead + +:: + + docker build . -t django-deployment-book + docker run -v "$(pwd):/opt/django" --rm django-deployment-book + After the above, the PDF should be in ``_build/latex`` and the epub in ``_build/epub``.