diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..08f931c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# ignore test builds +mkdocs/site diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a1c1137 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +# build the docs and load static files into nginx + +FROM python:3.10.9-slim-bullseye AS builder +ENV PATH=/root/.local/bin:$PATH + +RUN apt-get update && apt-get install -y --no-install-recommends \ + git + +COPY requirements.txt /requirements.txt +RUN pip install --user -r requirements.txt + +RUN git clone https://github.com/tubearchivist/docs.git +WORKDIR docs/mkdocs +RUN mkdocs build + +FROM nginx as srv +COPY --from=builder docs/mkdocs/site /usr/share/nginx/html diff --git a/README.md b/README.md index 56f7616..04abfe7 100644 --- a/README.md +++ b/README.md @@ -27,3 +27,14 @@ mkdocs serve ``` And the site - with live reload enabled - should be available on [localhost:8000](http://localhost:8000/). + +## Production environment +Build the Docker image: +``` +docker build -t bbilly1/tubearchivist-docs . +``` + +Run the image: +``` +docker run -p 80:80 bbilly1/tubearchivist-docs +``` diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..2681e52 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +mkdocs==1.4.2 +mkdocs-material==9.1.3