Nikola setup using Docker

Dockerfile

FROM python:3.6
MAINTAINER X

RUN apt-get update \
      && printf 'locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8\nlocales locales/default_environment_locale select en_US.UTF-8\n' | debconf-set-selections \
      && apt-get install --no-install-recommends -y \
              build-essential \
              libjpeg-dev \
              libxml2-dev \
              libxslt1-dev \
              libyaml-dev \
              libzmq3-dev \
              locales \
              python3-dev \
              python3-pip \
              zlib1g-dev \
      && pip install 'Nikola[extras]' \
      && useradd -c Nikola -m -s /bin/bash nikola

WORKDIR /home/nikola/my_blog/
EXPOSE 10000

USER nikola

ENTRYPOINT ["nikola"]

docker-compose.yml

version: "3"
services:
  nikola:
    build: .
    volumes:
      - .:/home/nikola
  auto:
    build: .
    ports:
      - "10000:10000"
    volumes:
      - .:/home/nikola
    command: "auto -p 10000 -a 0.0.0.0"

Initial setup and all nikola command except auto use: docker-compose run --rm nikola <command>

The auto nikola command is used like this: docker-compose up auto. You can now browse your live updated nikola on port 10000.