Skip to content
My homepage
CSS HTML Shell
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.
_includes
_layouts
_posts
_sass
assets
css
LICENSE
README.md
_config.yml
about.md
docker-compose.yml
feed.xml
index.html

README.md

cernivec-si

My homepage

Run the site with Docker

Check out: https://github.com/envygeeks/jekyll-docker

Next section is taken out of the site aboove.

Docker-Compose

version: "3"
services:
  site:
    command: jekyll serve
    image: jekyll/jekyll:latest
    volumes:
      - $PWD:/srv/jekyll
      - $PWD/vendor/bundle:/usr/local/bundle
    ports:
      - 4000:4000
      - 35729:35729
      - 3000:3000
      - 8080:4000

Usage

1. Create site:

docker-compose run site jekyll new mysite

2. Change to the new site's folder:

cd mysite

3. Initial build and serve:

docker-compose up -d

While running with above command you can:

Build again (for apply _config.yml file):

docker-compose exec site jekyll build

Note: If you want to create another site, then you have to stop the container, change to docker-compose's root folder and repeat the steps above.

docker-compose stop
cd ..

and back to 1.

Update the site with the newly added content

After adding a new markdown file with the new content, you need only to pull the new content from Github repo and rebuild the site with docker-compose:

git pull
docker-compose exec site jekyll build

and now, you are serving the newly created content. Of course, putting this in cronjob is better.

If this does not work, use -I switch with the command. This will take into account that this goes for incremental build.

Important: post must be in the past! In case you use future dates, there will be no post generated and no error! Strange.

Set up nginx

In the example above docker-compose file has port 8080 used as Jekyll's HTTP port. Nginx's .conf file should be similar to this:

server {
    server_name    cernivec.si www.cernivec.si;
    listen         80;
    listen         [::]:80;

  location / {
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_pass http://localhost:8080;
  }

}

Put the file under conf.d directory.

Installation - self-hosted

Installation of jekyll:

   sudo apt-get install ruby
   sudo gem install mkmf
   sudo apt-get install ruby1.9.1-dev
   sudo gem install jekyll

Usage

   jekyll b
   jekyll s

Post Jekyll setup

Serve the site via HTTPS (Let's Encrypt)

Check out these tutorials on how to set-up Let's Encrypt: https://linuxize.com/post/secure-nginx-with-let-s-encrypt-on-centos-7/

You can’t perform that action at this time.