Skip to content

Commit

Permalink
Merge pull request #265 from r0ssing/main
Browse files Browse the repository at this point in the history
Fixing docker issues
  • Loading branch information
wbrunette authored Dec 9, 2023
2 parents f4dfd69 + 8dc93dc commit a7dbfd7
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9.16-buster
FROM python:3.12.1

WORKDIR /mnt

Expand All @@ -13,6 +13,6 @@ RUN apt-get update -y && \
python -m pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt

ENTRYPOINT ["make"]
ENTRYPOINT ["make", "dockerserve"]

EXPOSE 8080
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ help:

.PHONY: help Makefile

dockerserve:
sphinx-autobuild --host 0.0.0.0 --port 8080 -b dirhtml "$(SOURCE_DIR)" "$(BUILD_DIR)/html"

serve:
sphinx-autobuild -b dirhtml "$(SOURCE_DIR)" "$(BUILD_DIR)/html"

Expand Down
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ODK-X Docs

![Platform](https://img.shields.io/badge/platform-Sphinx-blue.svg) [![License](https://img.shields.io/badge/license-CC%20BY%204.0-blue.svg)](https://creativecommons.org/licenses/by/4.0/) [![Build status](https://circleci.com/gh/odk-x/docs.svg?style=svg)](https://circleci.com/gh/odk-x/docs/) [![Netlify Status](https://api.netlify.com/api/v1/badges/d3788b3e-1abc-431d-a9a3-e5c71b20e053/deploy-status)](https://app.netlify.com/sites/blissful-bohr-7f32fb/deploys)
![Platform](https://img.shields.io/badge/platform-Sphinx-blue.svg) [![License](https://img.shields.io/badge/license-CC%20BY%204.0-blue.svg)](https://creativecommons.org/licenses/by/4.0/) [![Build status](https://circleci.com/gh/odk-x/docs.svg?style=svg)](https://circleci.com/gh/odk-x/docs/)

This repo is the source for ODK-X documentation.

Expand Down Expand Up @@ -93,14 +93,25 @@ Take note of the full-stop `.` at the end of the build command. The `.` specifie
### Building and serving the docs locally

Build and serve the docs locally with:
* Windows: `.\run-task.bat serve`
* Linux/macOS: `./run-task.sh serve`
* Windows: `.\run-task.ps1`
* Linux/macOS: `./run-task.sh`

Once your terminal shows a "Serving on http://0.0.0.0:8080" message, you can then view the docs in your browser at http://localhost:8080.

Changes you make in the source files will automatically be built and shown in your browser.
Changes you make in the source files (located in the `./src` folder) will automatically be re-built and shown in your browser.

* Windows: The docker container with the docs website will occupy the terminal window and output log messages when changes are detected and rebuilds are made. Open a new terminal window/tab to be able to stop the container using the command below.
* Linux/macOs: Open a new terminal to interact with the container or press `Ctrl-Z` on your keyboard to suspend the job. The job will still be running in the background and changes will automatically be rebuilt and served.


To stop the container, type the following command

```
docker stop odkx-docs
```



Press `Ctrl-C` on your keyboard to stop the build server. It could take a while to effectively stop, and you can always close the terminal window.

If you get a `The name "odkx-docs" is already in use by container` error message, run the following command:

Expand Down
1 change: 0 additions & 1 deletion run-task.bat

This file was deleted.

1 change: 1 addition & 0 deletions run-task.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker run --rm -v "${PWD}:/mnt" -p 8000:8000 --name odkx-docs odkx-docs
2 changes: 1 addition & 1 deletion run-task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"

docker run --rm -v "${DIR}":/mnt -p 8080:8080 --name odkx-docs odkx-docs "$1"
docker run --rm -v "${DIR}":/mnt -p 8080:8080 --name odkx-docs odkx-docs

0 comments on commit a7dbfd7

Please sign in to comment.