From 01c8336988c1ad5bc3f9aa285daae2f2e4bb1f42 Mon Sep 17 00:00:00 2001
From: Eliot Berriot <contact@eliotberriot.com>
Date: Mon, 12 Mar 2018 23:38:39 +0100
Subject: [PATCH] Added docker configuration to serve and build documentation
 with livereload

---
 dev.yml         |  9 +++++++++
 docs/Dockerfile |  4 ++++
 docs/serve.py   | 13 +++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 docs/Dockerfile
 create mode 100644 docs/serve.py

diff --git a/dev.yml b/dev.yml
index 2c102f3a..8d2129be 100644
--- a/dev.yml
+++ b/dev.yml
@@ -71,3 +71,12 @@ services:
       - ./api/funkwhale_api/media:/protected/media
     ports:
       - "0.0.0.0:6001:6001"
+
+  docs:
+    build: docs
+    command: python serve.py
+    volumes:
+      - ".:/app/"
+    ports:
+      - '35730:35730'
+      - '8001:8001'
diff --git a/docs/Dockerfile b/docs/Dockerfile
new file mode 100644
index 00000000..1067eb8b
--- /dev/null
+++ b/docs/Dockerfile
@@ -0,0 +1,4 @@
+FROM python:3.6-alpine
+
+RUN pip install sphinx livereload
+WORKDIR /app/docs
diff --git a/docs/serve.py b/docs/serve.py
new file mode 100644
index 00000000..9a381c74
--- /dev/null
+++ b/docs/serve.py
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+from subprocess import call
+# initial make
+call(["python", "-m", "sphinx", ".", "/tmp/_build"])
+from livereload import Server, shell
+
+server = Server()
+server.watch('.', shell('python -m sphinx . /tmp/_build'))
+server.serve(
+    root='/tmp/_build/',
+    liveport=35730,
+    port=8001,
+host='0.0.0.0')
-- 
GitLab