Skip to content

Commit

Permalink
Use Docker to run Gatekeeper (#630)
Browse files Browse the repository at this point in the history
Instead of having to setup Gatekeeper seperately, we can use Docker to help us
  • Loading branch information
jrock2004 authored and Gaurav0 committed Jul 7, 2018
1 parent 45c8597 commit 9d2ca91
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .bowerrc
@@ -1,4 +1,5 @@
{
"directory": "bower_components",
"analytics": false
"analytics": false,
"registry": "https://registry.bower.io"
}
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -25,3 +25,6 @@ testem.log
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try

# Ignore submodule
gatekeeper
3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "gatekeeper"]
path = gatekeeper
url = https://github.com/prose/gatekeeper.git
25 changes: 22 additions & 3 deletions CONTRIBUTING.md
Expand Up @@ -48,16 +48,35 @@ You will need the following things properly installed on your computer.

### Running / Development With Docker (OPTIONAL)

Docker has been setup to make things easier to get setup and working.

#### Additional Dependencies

* [Docker](https://docs.docker.com/install/) (Optional)
* [Docker Compose](https://docs.docker.com/compose/install/) (Optional)

#### Instructions

* `node index.js` from your gatekeeper folder
* `docker-compose up` from ember twiddle folder
* Visit your app at [http://localhost:4200](http://localhost:4200).
First thing you want to do is edit the `docker-compose.yml`
file and change the `CHANGEME` to match your keys and secrets.
Then you will want to run the following commands:

``` bash
# Pull gatekeeper code
$ git submodule init
$ git submodule update

# Start Docker
$ docker-compose up

# When you are done coding, to stop the container, hit Ctrl+C
$ docker-compose stop

# When you want to start again
$ docker-compose start
```

Visit the app at [http://localhost:4200](http://localhost:4200).

### Code Generators

Expand Down
24 changes: 19 additions & 5 deletions docker-compose.yml
Expand Up @@ -2,18 +2,32 @@ version: '3'

services:
ember:
image: danlynn/ember-cli:2.11.1
image: danlynn/ember-cli:2.16.2-node_8.7
container_name: ember-twiddle
ports:
- 4200:4200
- 49153:49153
volumes:
- .:/myapp
- ./entrypoint.sh:/entrypoint.sh
- /app/bower_components
- /app/node_modules
- /app/tmp
- /app/dist
- /myapp/bower_components
- /myapp/node_modules
- /myapp/dist
tmpfs:
- /myapp/tmp
environment:
- GH_API_KEY=CHANGEME
command: ["sh", "/entrypoint.sh"]
gatekeeper:
image: node:6.11.1-alpine
container_name: gatekeeper-twiddle
working_dir: /home/node/app
environment:
- NODE_ENV=production
- OAUTH_CLIENT_ID=CHANGEME
- OAUTH_CLIENT_SECRET=CHANGEME
volumes:
- ./gatekeeper:/home/node/app
ports:
- 9999:9999
command: /bin/sh -c "yarn && npm run start"
7 changes: 2 additions & 5 deletions entrypoint.sh
@@ -1,10 +1,7 @@
#!/bin/bash

# Installing yarn
npm install -g yarn

# Install the project dependencies
yarn
bower install --allow-root
bower install --allow-root & wait
yarn & wait

ember server

0 comments on commit 9d2ca91

Please sign in to comment.