On-Premises ReadTheDocs (RTD) Docker Container
This is an on-premises setup of ReadTheDocs (RTD) with full support for LaTeX-to-PDF and other bells-and-whistles installed at readthedocs.org.
Installed packages include:
This setup allows private GitHub and Visual Studio Online (VSO) Git documentation projects.
GitHub repository URLs are of the form:
VSO Git repository URLs are of the form:
This image also removes the infamous account email verification on user sign-up.
Run the Container
docker run -d -it -p 8000:8000 -e "RTD_PRODUCTION_DOMAIN=my_domain.com:8000" --name readthedocs vassilvk/readthedocs
The above example starts the container with the assumption that it will be accessed at http://my_domain.com:8000.
Change the port mappings and environment variable
RTD_PRODUCTION_DOMAIN to reflect your setup.
You need to run the container only once. After that you only need stop and start it:
docker stop readthedocs
docker start readthedocs
When you run the container for the first time, it creates a container volume where it stores the RTD data.
Removing the container will delete the container's volume with all the RTD data. Don't remove it unless you want to re-import your RTD projects from scratch.
Persist the Volume
If you need to be able to delete the container and still persist your project data, you can do so by mounting a host folder which contains a copy of the initial container volume.
Once the container is run with the above run command, you can copy the volume to a well-known folder at your host.
This will let you bind the container's volume to this host folder which will allow you to persist the data even after container the container is deleted and re-run.
To find the location where Docker stores the volume, run the following command while the container is running or stopped, but not deleted:
docker inspect readthedocs
- Look for the
Mountsproperty and take a note of the
- Stop the container:
docker stop readthedocs.
- Copy that folder to a folder on your host, for example
Once you do that, you can delete the container:
docker rm readthedocs.
Now you can start the container by mounting the host-provided folder like this:
docker run -d -it -p 8000:8000 -e "RTD_PRODUCTION_DOMAIN=my_domain.com:8000" -v ~/readthedocs.org:/www/readthedocs.org --name readthedocs vassilvk/readthedocs
Access the Application
To access the web application hosted by the container, navigate to http://my_domain.com:8000/ where "my_domain.com" is the address of the container host.
You can access the site with user