add Dockerfile and README.md

This commit is contained in:
Patrick Werner 2020-02-12 22:41:07 +01:00
parent c43c3a749f
commit 2b04dfb4c5
No known key found for this signature in database
GPG Key ID: C078A3328BEC8B94
2 changed files with 27 additions and 0 deletions

6
Dockerfile Normal file
View File

@ -0,0 +1,6 @@
FROM python:3.8.1-buster
RUN apt update && apt upgrade -y
RUN pip install pelican==4.2.0
WORKDIR /site
RUN mkdir -p /site-generated
ENTRYPOINT ["pelican", "-Dr", "-o", "/site-generated"]

21
README.md Normal file
View File

@ -0,0 +1,21 @@
# Docker image with [Pelican](https://blog.getpelican.com/)
Create a volume for the output files.
```
docker volume create pelican_files
```
Run the pelican build with your site, replace `<your-site-dir>` with the directory of your Pelican source files. The output will be written into the previously created volume `pelican_files`. Changes are regenerated automatically.
```
docker run --detach \
--name=pelican \
--volume <your-site-dir>:/site \
--volume pelican_files:/site-generated \
boonto/pelican:3.8.1-4.2.0
```
May be used in conjunction with the [nginx](https://hub.docker.com/_/nginx) container to serve the output.
```
docker run --detach \
--name=site \
--volume pelican_files:/usr/share/nginx/html:ro \
nginx
```