I was getting frustrated from Chrome asking me
Make page mobile-friendly
when visiting our own blog. So I started to look for alternative mobile friendly themes.
The final choice was: Pelican Attila Theme.
While rebuilding the blog from scratch I failed with our old approach Setting Up a Virtual Pelican Environment.
As of today we gathered some Docker knowhow and I decided to try a new way...
I started FROM
a small Alpine based Python image: library/python.
All basic requirements we have with our blog software Pelican are listed in requirements.txt
- as described in Requirements Files
pelican==3.7.1
markdown==2.6.8
This results in the following Dockerfile
:
FROM python:3.3.6-alpine
MAINTAINER devop@datenkollektiv.de
WORKDIR /usr/src/app
ADD requirements.txt .
RUN pip install -r requirements.txt
Let's build a container capable of building our blog
docker build . -t datenkollektiv/pelican
Building the content once
docker run -it --rm -v "$PWD":/usr/src/app datenkollektiv/pelican pelican content
works as expected.
For development:
docker run -it --rm -v "$PWD":/usr/src/app datenkollektiv/pelican pelican --debug --autoreload
The preview works straight forward, too:
docker run -it --rm -p 8000:8000 -v "$PWD":/usr/src/app -w="/usr/src/app/output" datenkollektiv/pelican python -m pelican.server 8000
Verify the results at localhost:8000.
Et voilà: Old wine in new bottles: {devops blog}...