diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9218470 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM ruby + +RUN gem install bundler -v 2.3.18 + +WORKDIR /usr/src/app + +COPY . . + +RUN bundle install diff --git a/Gemfile b/Gemfile index f85f962..6750b32 100755 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,4 @@ source 'https://rubygems.org' -require 'json' -require 'open-uri' -versions = JSON.parse(open('https://pages.github.com/versions.json').read) - -gem 'github-pages', versions['github-pages'] +gem 'github-pages' +gem "webrick", "~> 1.7" diff --git a/README.md b/README.md index f00dde3..2a38d09 100755 --- a/README.md +++ b/README.md @@ -2,44 +2,22 @@ A site for the CFPB to share and discuss its technology work with the world. -## Running it locally +## Running it locally with Docker Content editors and developers probably want to set up cfpb.github.io on their local machine so they can preview updates without pushing to GitHub. -Before you get started make sure you have an up-to-date version of Ruby and Bundler. -We use [Homebrew](http://brew.sh/): - -```sh -brew install ruby -gem install bundler -``` - -As the site is intended to be deployed on GitHub Pages, installing the -GitHub Pages gem is the best way to install Jekyll and related dependencies. -Run the following command to install it: - -```sh -bundle install -``` - -**Note:** As of 6/23/16, you may need to run this command before running -`bundle install` to handle a bug in one of the dependencies: - -```sh -bundle config build.nokogiri --use-system-libraries -``` +Before you get started, make sure you have an up-to-date version of [Docker](https://www.docker.com/get-started/) installed on your machine and that it is running. [Fork and clone the repo](https://help.github.com/articles/fork-a-repo/) to your local machine. -From the project directory, run Jekyll: - +Using terminal, in the project directory, run: ```sh -bundle exec jekyll serve --watch -``` +docker-compose up +``` -Open it up in your browser: +Open it up in your browser: [http://localhost:4000/](http://localhost:4000/) ## Working with the front end diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..8ef1d71 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,11 @@ +version: '3' + +services: + web: + build: . + container_name: cfpb-io-container + command: bundle exec jekyll serve --host 0.0.0.0 + volumes: + - .:/usr/src/app + ports: + - "4000:4000" \ No newline at end of file