Skip to content

Commit

Permalink
Fix docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
Thalhammer committed Jun 29, 2024
1 parent bdd0c83 commit 31e2b75
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 21 deletions.
4 changes: 0 additions & 4 deletions Docker.sh

This file was deleted.

16 changes: 0 additions & 16 deletions Dockerfile

This file was deleted.

20 changes: 20 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
9 changes: 9 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -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`
2 changes: 2 additions & 0 deletions docker-entrypoint.sh → docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash
set -Eeo pipefail

cd /work

./grabrepos.py
hugo
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ pymdown-extensions==6.0
PyYAML==5.3.1
six==1.11.0
smmap2==2.0.5
tornado==5.1.1

0 comments on commit 31e2b75

Please sign in to comment.