summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook@pioneer.com>2021-04-04 21:21:24 -0500
committerJordan Cook <jordan.cook@pioneer.com>2021-04-04 21:21:24 -0500
commit8ae34b76e045fdab57e95b01c66e86062169fde3 (patch)
tree03a63172be36da7ddf332ae909200a18aca87ef7
parent0ef5121050e4eaf459a0e14b0b8511b01f63bb5c (diff)
downloadrequests-cache-8ae34b76e045fdab57e95b01c66e86062169fde3.tar.gz
Add Dockerfile + docker-compose config to make it easier to run the readthedocs build container
-rw-r--r--CONTRIBUTING.md17
-rw-r--r--docker-compose.yml15
-rw-r--r--docs/Dockerfile5
3 files changed, 25 insertions, 12 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e3f7340..7410f5c 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -97,17 +97,14 @@ $ xdg-open docs/_build/index.html
### Readthedocs
Sometimes, there are differences in the Readthedocs build environment that can cause builds to
-succeed locally but fail remotely. To help debug this, you can use the Readthedocs Docker container
-(`readthedocs/build`) to perform the build. Example:
+succeed locally but fail remotely. To help debug this, you can use the
+[readthedocs/build](https://github.com/readthedocs/readthedocs-docker-images) container to build
+the docs. A configured build container is included in `docker-compose.yml` to simplify this.
+
+Run with:
```bash
-docker pull readthedocs/build
-docker run --rm -ti \
- -v (pwd):/home/docs/project \
- readthedocs/build \
- /bin/bash -c \
- "cd /home/docs/project \
- && pip3 install '.[docs,backends]' \
- && make -C docs html"
+docker-compose up -d --build
+docker exec readthedocs make all
```
## Pull Requests
diff --git a/docker-compose.yml b/docker-compose.yml
index 8b05132..d9b2452 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,5 +1,5 @@
# Containers needed to test all backend services locally
-version: '3'
+version: '3.7'
services:
httpbin:
@@ -36,10 +36,21 @@ services:
- '6379:6379'
environment:
ALLOW_EMPTY_PASSWORD: 'yes'
- # REDIS_DISABLE_COMMANDS: 'FLUSHDB,FLUSHALL'
volumes:
- 'redis_data:/bitnami/redis/data'
+ readthedocs:
+ container_name: readthedocs
+ build:
+ context: .
+ dockerfile: docs/Dockerfile
+ network: host
+ user: '1000'
+ tty: true
+ volumes:
+ - '.:/home/docs/project'
+ working_dir: '/home/docs/project/docs'
+
volumes:
mongodb_data:
driver: local
diff --git a/docs/Dockerfile b/docs/Dockerfile
new file mode 100644
index 0000000..8981589
--- /dev/null
+++ b/docs/Dockerfile
@@ -0,0 +1,5 @@
+# Readthedocs build container with project dependencies pre-installed
+FROM readthedocs/build:8.0
+COPY . /src/
+RUN pip3 install -U /src/[docs,backends]
+ENTRYPOINT ["/bin/bash"]