bruffridge / jekyll-docker

Build and serve a Jekyll site in a docker container.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jekyll-docker

Build and serve a Jekyll site in a docker container.

Setup

  1. Install Docker
  2. Clone or download this repo into jekyll-docker on your machine.
  3. Have a Jekyll site on your computer or clone this NASA Web Design Standards starter site to your machine. Your jekyll site will need to have a package.json with a start script that runs jekyll serve like this
  4. Open a bash terminal and cd to jekyll-docker
  5. Build a docker image named jekyll-docker by running this command: docker build -t jekyll-docker .
  6. Build and run the jekyll site within a docker container named my_jekyll_site (feel free to rename). Also you can choose a different name for jekyll-site if you desire: docker run -it --name my_jekyll_site -p 127.0.0.1:4000:4000 -v /path/to/my/jekyll-site:/apps/jekyll-site jekyll-docker start jekyll-site
  7. Access your site at 127.0.0.1:4000 in a browser. Make changes to your site source files and the jekyll site running on http://127.0.0.1:4000/ will be updated automatically. Just refresh your browser to see the changes.
  8. Ctrl+C to stop the server
  9. Next time you want to start the server: docker start -ai `docker ps -a -q -f "name=my_jekyll_site"`

Other helpful docker commands

Stop latest container

docker stop `docker ps -q -l`

Remove all stopped containers

docker rm $(docker ps -a -q)

About

Build and serve a Jekyll site in a docker container.

License:Other


Languages

Language:Shell 100.0%