Added website

This commit is contained in:
palo 2024-11-29 04:07:46 +01:00
parent 6db03085d1
commit b1b374ac19
4 changed files with 39 additions and 0 deletions

14
website/Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM python:latest
WORKDIR /usr/local/app
# Install the application dependencies
RUN pip install --no-cache-dir pelican icalendar markdown
VOLUME ["/usr/local/app/source"]
VOLUME ["/usr/local/app/output"]
# Execute the execute.sh file
COPY execute.sh /usr/local/app/execute.sh
RUN chmod +x /usr/local/app/execute.sh
CMD ["/usr/local/app/execute.sh"]

6
website/Makefile Normal file
View File

@ -0,0 +1,6 @@
DOCKER ?= docker
IMAGE ?= website
.PHONY: build
build:
$(DOCKER) build -t $(IMAGE) .

7
website/execute.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
# Pull the website from git
cd source && git pull
# Compile the markdown to HTML in a volume
make html OUTPUTDIR=/usr/local/app/output

12
website/run.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
docker run --rm \
--name website \
--network unitservices \
--volume /var/unit/website/source:/usr/local/app/source \
--volume /opt/nginx/unit.abbiamoundominio.org:/usr/local/app/output \
--add-host git.abbiamoundominio.org:192.168.122.2 \
website
# XXX: the --add-host was added because the container could not resolve the domain of the gitserver
# TODO: what do we change 192.168.122.2 to, when Amelia is gone?