Simple websites with Jekyll and Docker

Josh Habdas

Installing Jekyll

Clone a Jekyll seed

  git clone \
            lanyon && cd $_

Using Mark Otto's Lanyon seed

Add Dockerfile, etc.

  curl -O
  curl -O
  curl -O

Grab raw sources, then customize

Get dependencies

  bundle install

Creates the Gemfile.lock referenced in the Dockerfile

Build, run, test

  docker build -t webapp .
  docker run -d -p 80:80 webapp
  curl $(boot2docker ip)

Run site on DigitalOcean

Create Docker Droplet

Create a new user

But in the interest of time...

Upload the site

  git add -A && git commit -m "All the things"
  git archive -o app.tar.gz --prefix=app/ master
  scp app.tar.gz root@HOST:

Build and run

  ssh root@HOST
  tar zxvf app.tar.gz && docker build -t webapp app/
  docker run -d -p 80:80 webapp

Use -d flag to run daemonized

Confirm site is running

Stopping the site

  docker stop $(docker ps -lq)


Simple websites with Jekyll and Docker

By Josh Habdas

Simple websites with Jekyll and Docker

How to host a simple Jekyll site on Docker with DigitalOcean.

  • 4,400