-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
44 lines (40 loc) · 1.77 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# DESCRIPTION: Sphinx server
# AUTHOR: Daniel Mizyrycki <[email protected]>
#
# COMMENTS: sphinxserve is a tool to effectively document projects
# Using a docker volume, it monitors a sphinx directory, renders
# and http serves the results when the source documents change.
# This docker image is based in the python package sphinxserve
# https://pypi.python.org/pypi/sphinxserve
#
# TO BUILD: docker build -t mzdaniel/sphinxserve .
#
# HELP: docker run mzdaniel/sphinxserve --help
#
# TO INSTALL: # creating ~/bin/sphinxserve (small script calling docker)
# docker run mzdaniel/sphinxserve install | bash
#
# TO RUN: ~/bin/sphinxserve [SPHINX_DOCS_PATH]
# or
# docker run -it -v $PWD:/host -p 8888:8888 \
# mzdaniel/sphinxserve [SPHINX_DOCS_PATH]
FROM alpine
MAINTAINER Daniel Mizyrycki [email protected]
ADD . /tmp/sphinxserve
# Build and install sphinxserve_pex wheel
RUN \
mkdir /tmp/pkg /.pex && \
chown 1000 /.pex && \
apk update && \
apk add curl sudo python alpine-sdk python-dev libffi-dev openssl-dev && \
curl https://bootstrap.pypa.io/get-pip.py | python && \
pip install wheel tox && \
pip wheel --wheel-dir=/tmp/pkg "gevent>=1.1b2" && \
sed -Ei 's|(sphinx<1.3)|\1 -f /tmp/pkg|' /tmp/sphinxserve/tox.ini && \
cd /tmp/sphinxserve; tox -e build && \
pip install -U /tmp/sphinxserve/dist/sphinxserve_pex*.whl && \
apk del curl alpine-sdk python-dev libffi-dev openssl-dev && \
pip uninstall -y wheel tox virtualenv && \
rm -rf /var/cache/apk/* /root/.cache /tmp/* && \
find /usr/lib/python2.7 \( -name '*.py' -o -name '*.pyo' \) -exec rm {} \;
ENTRYPOINT ["/usr/bin/sphinxserve"]