Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build docker-compose functionality for easier set-up #257

Merged
merged 7 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ruby

RUN gem install bundler -v 2.3.18

WORKDIR /usr/src/app

COPY . .

RUN bundle install
7 changes: 2 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -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"
34 changes: 6 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <http://localhost:4000/>
Open it up in your browser: [http://localhost:4000/](http://localhost:4000/)


## Working with the front end
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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"