Skip to content

Instantly share code, notes, and snippets.

@kencochrane
Created April 1, 2017 19:46
Show Gist options
  • Save kencochrane/9047c8765fc127449b7760726f113cda to your computer and use it in GitHub Desktop.
Save kencochrane/9047c8765fc127449b7760726f113cda to your computer and use it in GitHub Desktop.
building the moviepy docs with Docker
FROM python:3
ENV LC_ALL C.UTF-8
ADD . /code/
WORKDIR /code
RUN python setup.py install
RUN python -c "import imageio; imageio.plugins.ffmpeg.download()"
RUN pip install -r requirements_docs.txt
RUN cd docs && make html
WORKDIR /docs/html
CMD ["python", "-m", "http.server", "9000"]
EXPOSE 9000

Prerequisites

  1. Docker installed (Docker for Mac, Docker for windows, linux, etc)

Steps to build and read docs

  1. Put the Dockerfile.docs into the root directory of moviepy, same level as setup.py
  2. build the moviepy docs image docker build -t moviepy/docs -f Dockerfile.docs .
  3. run the moviepy/docs container docker run -d -p 9000:9000 --name moviepy_docs moviepy/docs
  4. Go to your browser and connect to http://localhost:9000

To look inside of the container.

The files are installed in /docs/html inside of the container.

If already running, you can connect to the running container.

docker exec -it moviepy_docs bash

If the container isn't running already

docker run -it moviepy/docs bash

If you want to copy the compiled docs out of the container to look at them locally.

# change to the directory where you want to have the docs copied to locally
mkdir -p /tmp/moviepy_docs
cd /tmp/moviepy_docs

# this will copy the /docs directory out of the container and into the current directory
docker cp moviepy_docs:/docs .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment