Skip to content

Adds Dockerfile and instructions on how to compile with Docker #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``.

Expand Down