Giter VIP home page Giter VIP logo

jekyll-nginx-proxy-with-docker-demo's Introduction

Demo: Jekyll + nginx proxy via Docker

This has been tried and tested on Mac OS X. It should work on Linux as well. However, Windows is not guranteed, as Jekyll does not officially support it.

Prerequisites

  • Ruby 2.0+
  • Python 2.7+
  • NodeJS v0.12.* with npm v2.0+
  • Bower. (get via npm install -g bower)
  • Docker (you can get it through Docker Toolbox)

Getting Started

Run the following commands on the project root:

> bundle install --path vendor/bundle
> npm install && bower install

Get your local IP address and set it as the LOCAL_IP environment variable:

> export LOCAL_IP=192.168.99.1

This IP address should be what Docker can use to talk to your host machine. 192.168.99.1 should be what it is for a default install of Docker.

Serving the static site

Run:

> grunt serve

Once complete, a browser window should eventually open up pointing to http://localhost:8080.

To hit the proxy, you will have to access the site through http://192.168.99.1.

Test the following redirects to see it in action:

http://192.168.99.1/activelamp => http://activelamp.com

http://182.168.99.1/bienvenue => http://192.168.99.1/jekyll/update/2015/10/15/welcome-to-jekyll/

The first redirect is configured in _config.yml. The second one is in app/_posts/2016-10-15-welcome-to-jekyll.md.

Grunt config & tasks

The grunt proxy task is the entry task that orchestrates the building and running of the nginx proxy. Checkout the Gruntfile.js file for how it is done. Its a rather long file (~300 lines), so I added @notes in comments preceeding all pertinent parts.

Majority of the implementation can be found in grunt/tasks/nginx-proxy/index.js.

Jekyll::NginxConfig

You can find more info about this module here: https://github.com/activelamp/jekyll-nginx-config

Questions?

For questions, comments, and feedbacks, you can shoot me an email at [email protected].

jekyll-nginx-proxy-with-docker-demo's People

Contributors

bezhermoso avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

mba811

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.