Skip to content

Commit f458a1f

Browse files
Build docker-compose functionality for easier set-up (#257)
Switch to Docker-based local build & update docs
1 parent 7094966 commit f458a1f

File tree

4 files changed

+28
-33
lines changed

4 files changed

+28
-33
lines changed

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM ruby
2+
3+
RUN gem install bundler -v 2.3.18
4+
5+
WORKDIR /usr/src/app
6+
7+
COPY . .
8+
9+
RUN bundle install

Gemfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
source 'https://rubygems.org'
22

3-
require 'json'
4-
require 'open-uri'
5-
versions = JSON.parse(open('https://pages.github.com/versions.json').read)
6-
7-
gem 'github-pages', versions['github-pages']
3+
gem 'github-pages'
4+
gem "webrick", "~> 1.7"

README.md

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,22 @@
22

33
A site for the CFPB to share and discuss its technology work with the world.
44

5-
## Running it locally
5+
## Running it locally with Docker
66

77
Content editors and developers probably want to set up cfpb.github.io on
88
their local machine so they can preview updates without pushing to GitHub.
99

10-
Before you get started make sure you have an up-to-date version of Ruby and Bundler.
11-
We use [Homebrew](http://brew.sh/):
12-
13-
```sh
14-
brew install ruby
15-
gem install bundler
16-
```
17-
18-
As the site is intended to be deployed on GitHub Pages, installing the
19-
GitHub Pages gem is the best way to install Jekyll and related dependencies.
20-
Run the following command to install it:
21-
22-
```sh
23-
bundle install
24-
```
25-
26-
**Note:** As of 6/23/16, you may need to run this command before running
27-
`bundle install` to handle a bug in one of the dependencies:
28-
29-
```sh
30-
bundle config build.nokogiri --use-system-libraries
31-
```
10+
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.
3211

3312
[Fork and clone the repo](https://help.github.com/articles/fork-a-repo/)
3413
to your local machine.
3514

36-
From the project directory, run Jekyll:
37-
15+
Using terminal, in the project directory, run:
3816
```sh
39-
bundle exec jekyll serve --watch
40-
```
17+
docker-compose up
18+
```
4119

42-
Open it up in your browser: <http://localhost:4000/>
20+
Open it up in your browser: [http://localhost:4000/](http://localhost:4000/)
4321

4422

4523
## Working with the front end

docker-compose.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: '3'
2+
3+
services:
4+
web:
5+
build: .
6+
container_name: cfpb-io-container
7+
command: bundle exec jekyll serve --host 0.0.0.0
8+
volumes:
9+
- .:/usr/src/app
10+
ports:
11+
- "4000:4000"

0 commit comments

Comments
 (0)