Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add docker container for building #12

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix docker build
  • Loading branch information
Thalhammer committed Jun 29, 2024
commit 31e2b756ab28e086de267df56d66b5479f76793e
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