Public Repository

Last pushed: 2 years ago
Short Description
Blog ready container images, using pelican blog engine, nginx and git for article versions control and deployment.
Full Description

Dockerfile

https://github.com/bpetit/dockerfiles/blob/master/pelican/Dockerfile

How to use it ?

Download the image

docker pull bpetit/pelican

Run a container base on the image

docker run -d  -i --name='myblog' --hostname='myblog01' -t bpetit/pelican

Attach to the container to setup pelican

Find the container small ID with:

docker ps

Then:

docker attach MYCONTAINERID

Give to pelican the informations it asks, only the title, the author's name and the url are relevant.

> What will be the title of this web site? My super blog
> Who will be the author of this web site? My Self
> What will be the default language of this web site? [en] 
> Do you want to specify a URL prefix? e.g., http://example.com   (Y/n) n
> Do you want to enable article pagination? (Y/n) 
> How many articles per page do you want? [10] 
> Do you want to generate a Fabfile/Makefile to automate generation and publishing? (Y/n) 
> Do you want an auto-reload & simpleHTTP script to assist with theme and site development? (Y/n) 
> Do you want to upload your website using FTP? (y/N) 
> Do you want to upload your website using SSH? (y/N) 
> Do you want to upload your website using Dropbox? (y/N) 
> Do you want to upload your website using S3? (y/N) 
> Do you want to upload your website using Rackspace Cloud Files? (y/N) 
> Do you want to upload your website using GitHub Pages? (y/N) 
Done. Your new project is available at /var/www/blog

When you see this message of success: hint Ctrl+p+q to detach the container.

Be careful: dont hint Ctrl+c, it would kill the container.

Be careful: if you specify a site url, it has to be the one that permits to reach the blog, otherwise there will be mistakes in links inside the html files and the blog theme will disappear.

Get informations to connect to the container

docker inspect myblog | grep Address
"IPAddress": "172.17.0.162",

docker logs myblog | grep 'initial pass'
root initial password: UCGFr4S838jysIQ8GsdftETe9x

Connect to the container using the initial password

ssh root@172.17.0.162

Change the root password ASAP

Add authorized ssh pubkeys to push articles

# su git
$ cd && vi .ssh/authorized_keys

Paste ssh pubkeys in this file, save and quit (:wq)

Exit and clone the git repository

git clone git@172.17.0.162:blog.git myblog

Then you can start to write articles (see http://docs.getpelican.com/en/3.4.0/content.html), commit and push. A push will trigger a regeneration of html pages with the new content.

Docker Pull Command
Owner
bpetit

Comments (0)