Skip to content
Just a minimalist blog built with hugo & docker.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
content
layouts
static
.gitignore
Dockerfile
README.md
config.toml
gulpfile.js
nginx.conf
package-lock.json
package.json
wercker.yml

README.md

juliocesar.io

This blog is build with hugo, which is a static site generator. See Hugo.

Building

On Docker machine, run in the the root dir of this repo:

$ docker build -t blog .

Docker should setup all you need, dependencies, the hugo client and a the settings for the server in nginx.

Deploy

Once you have the image build, you can run in a container with Docker run:

$ docker run --name blog -d -p 80:80

Verify that is up and running through the 80 port !!

Extra

If you want to have a easy way to publish your content without dealing with devops stuff, you can now setup a webhook using github, and docker hub with an automated build repository.

a CI like environment

I'm using an app in Flask that's triggered a script every time docker hub detects a commit from github.

When the commit is made, docker hub build the image, when is finished the webhook make a POST to the server.

You have to define an endpoint. Ex:

http://IP:port/ping?token=12345

When is done, the server validate and run the script in app/deploy.sh, if the token is correct then respond to the client in JSON format jsonify(success=True)

if request.method == 'POST':
       token = request.args.get('token')
       if str(token) == str(os.environ.get('TOKEN')):
           subprocess.call("app/deploy.sh")
           return jsonify(success=True)
       return jsonify(success=False), 500

Here is my script look like:

#!/bin/bash
docker pull uzi200/juliocesar.io
docker stop blog
docker rm blog
docker run --name blog -d -p 80:80 uzi200/juliocesar.io

You can take a look to the repo for the webhook listener app here.

I hope this serve anyone who want a blog without a messy CMS's and complicated things just for blogging !

You can’t perform that action at this time.