• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

jekyll

Jekyll on Docker Container

August 30, 2022

Here’s how to run Jekyll in a Docker container.

mkdir blog
cd blog
docker run -v $(pwd):/site bretfisher/jekyll new .
docker run -p 4000:4000 -v $(pwd):/site bretfisher/jekyll-serve

mkdir blog cd blog docker run -v $(pwd):/site bretfisher/jekyll new . docker run -p 4000:4000 -v $(pwd):/site bretfisher/jekyll-serve

Another option is to use docker compose. Create a docker-compose.yml file.

version: 3.5
services:
  jekyll:
    image: bretfisher/jekyll-serve
    volumes:
      - .:/site
    ports:
      - '4000:4000'

version: 3.5 services: jekyll: image: bretfisher/jekyll-serve volumes: - .:/site ports: - '4000:4000'

Run Jekyll.

cd blog
docker-compose up -d

cd blog docker-compose up -d

Stop Jekyll.

cd blog
docker-compose down

cd blog docker-compose down

Filed Under: Linux Tagged With: container, docker, docker-compose, down, jekyll, up

Install Jekyll on Amazon Linux 2

February 2, 2021

Here’s the script to install Jekyll on Amazon Linux 2.

#!/bin/bash
sudo hostnamectl set-hostname jekyll
sudo yum update -y
sudo amazon-linux-extras install ruby2.4 -y
sudo yum install ruby ruby-devel -y
sudo yum groupinstall "Development Tools" -y
sudo gem install bundler 
sudo gem install rdoc
sudo gem update --system
sudo gem install jekyll
jekyll new myblog

#!/bin/bash sudo hostnamectl set-hostname jekyll sudo yum update -y sudo amazon-linux-extras install ruby2.4 -y sudo yum install ruby ruby-devel -y sudo yum groupinstall "Development Tools" -y sudo gem install bundler sudo gem install rdoc sudo gem update --system sudo gem install jekyll jekyll new myblog

To start the Jekyll server.

cd mysite
jekyll build
jekyll serve --host 0.0.0.0

cd mysite jekyll build jekyll serve --host 0.0.0.0

Open your browser and point it to the external IP of your instance on port 4000.

http://xxx.xxx.xxx.xxx:4000

http://xxx.xxx.xxx.xxx:4000

You may to edit your security group to allow ingress 4000 from 0.0.0.0/0.

Filed Under: Linux Tagged With: amazon 2, bundler, gems, install, jekyll, ruby

Run Jekyll in Background

August 7, 2019

Jekyll is a static website generator you can use for developing simple websites. If you are running Jekyll on your desktop, you can view your static website by running a local server. If you want the leave the web server up and running in the background all the time, you can run this command instead.

# normally you run this command
jekyll serve
# running it in the background
jekyll serve > /dev/null 2>&1 &
# add incremental which builds only deltas
jekyll serve --incremental > /dev/null 2>&1 &

# normally you run this command jekyll serve # running it in the background jekyll serve > /dev/null 2>&1 & # add incremental which builds only deltas jekyll serve --incremental > /dev/null 2>&1 &

To kill the server, run the following.

# find jekyll server process
ps -ef | grep jekyll
# substitute pid# with process id
kill -9 pid#

# find jekyll server process ps -ef | grep jekyll # substitute pid# with process id kill -9 pid#

Filed Under: Cloud, Linux Tagged With: generator, jekyll, serve, static, website

Serverless Jekyll on AWS

July 21, 2017

I recently started playing around with Jekyll.

Jekyll is a flat-file CMS that doesn’t need a database. You don’t even need to know HTML to work with it. You just write your content using the Markdown language on any text editor. Once you’re done editing, you run “jekyll build” and Jekyll takes care of the rest. Since Jekyll files are stored on flat-files, you have quite a few choices where to host your website. You can host it on just about any hosting provider. You can have it hosted on Github for free, or better yet can run it as a serverless website on Amazon S3. Serverless meaning, it’s not running on a web server since S3 can host static files. In addition, you can take advantage of Cloudfront for its content distribution to speed up your website, and give it high availability.

So, here’s a demo of Jekyll running on AWS S3 and Cloudfront.

You can learn more about Jekyll by visiting their website.

Filed Under: Cloud Tagged With: aws s3, cloudfront, jekyll

  • Home
  • About
  • Archives

Copyright © 2023