diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..fff9182 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,20 @@ +FROM python:3.12-slim-bookworm + +RUN apt update \ + && apt install -y wget git \ + && git config --global --add safe.directory '*' + +# Copy the local repo contents +COPY ./requirements.txt /requirements.txt +COPY ./docker/docker-entrypoint.sh /docker-entrypoint.sh + +RUN pip install -r requirements.txt + +# Install Hugo +RUN wget https://github.com/gohugoio/hugo/releases/download/v0.102.3/hugo_extended_0.102.3_Linux-64bit.deb -O /tmp/hugo.deb \ + && dpkg -i /tmp/hugo.deb + +WORKDIR /work +VOLUME [ "/work" ] + +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..dfa3de4 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,9 @@ +# Docker build support + +To build a container that contains everything required to build and update the website execute the following command. + +`docker build . -f docker/Dockerfile -t homie-site:dev` + +After that the docker image can be used to build the website in the current directory using something like this. + +`docker run --rm -v $PWD:/work homie-site:dev` \ No newline at end of file diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh new file mode 100755 index 0000000..8e1ab48 --- /dev/null +++ b/docker/docker-entrypoint.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -Eeo pipefail + +cd /work + +./grabrepos.py +hugo diff --git a/requirements.txt b/requirements.txt index 524ff3b..e066983 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,4 +10,3 @@ pymdown-extensions==6.0 PyYAML==5.3.1 six==1.11.0 smmap2==2.0.5 -tornado==5.1.1