Skip to content

Instantly share code, notes, and snippets.

@wtbarnes
Last active June 16, 2016 05:03
Show Gist options
  • Save wtbarnes/63ab62aa6c7bdd0e9e9d783b30c55950 to your computer and use it in GitHub Desktop.
Save wtbarnes/63ab62aa6c7bdd0e9e9d783b30c55950 to your computer and use it in GitHub Desktop.
Docker image for ReadTheDocs build. Can be used for testing RTD Sphinx builds locally. Built on Python base image from Docker Hub
#################################################################################################
# Dockerfile to build ReadTheDocs
# Can be used to build RTD locally to test Sphinx build
# See RTD installation instructions http://read-the-docs.readthedocs.io/en/latest/install.html
#################################################################################################
FROM python:2-onbuild
MAINTAINER Will Barnes
# update and install needed applications from apt-get
RUN apt-get update && apt-get install -y \
git \
build-essential \
libxml2-dev \
libxslt1-dev \
zlib1g-dev
# pip tools
RUN pip install --upgrade pip
# initial setup
RUN virtualenv rtd
CMD cd rtd
RUN source bin/activate
CMD mkdir checkouts && cd checkouts
RUN git clone https://github.com/rtfd/readthedocs.org.git
CMD cd readthedocs.org
# install dependencies
RUN pip install -r requirements.txt
# setup the server
CMD python manage.py migrate
CMD python manage.py createsuperuser
CMD python manage.py collectstatic
# set user and password
ENV SLUMBER_USERNAME admin
ENV SLUMBER_PASSWORD passwd
# run the server
CMD python manage.py runserver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment