Skip to content

Commit

Permalink
Add docker capability (#149)
Browse files Browse the repository at this point in the history
* add docker capability

* add example of env to run with docker

* update readme to include run with docker section

* update bundle version

* update dockerfile to use bundler version 2

* remove gojek reference on env example

* remove gojek reference on application.yml sample
  • Loading branch information
walbertus authored and giosakti committed May 17, 2019
1 parent 1357aef commit 1ed67f6
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/log/*
!/log/.keep
/tmp
.idea
.env
*.swp
config/application.yml
public/assets/*
dump.rdb
coverage
.git
20 changes: 20 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
GATE_OAUTH_CLIENT_ID=
GATE_OAUTH_CLIENT_SECRET=
GATE_HOSTED_DOMAIN=
GATE_SERVER_URL=
GATE_CONFIG_SECRET=
GATE_EMAIL_DOMAIN=
GATE_HOSTED_DOMAINS=
USER_ROLES=employee,consultant
PRODUCT_LIST=
CACHE_PORT=
CACHE_HOST=
GATE_DB_HOST=
GATE_DB_PORT=
GATE_DB_USER=
GATE_DB_PASSWORD=
DEFAULT_HOST_PATTERN=s*
UID_BUFFER=5000
SAML_APPS=datadog
GATE_URL=
SIGN_IN_TYPE=
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ruby:2.4

RUN apt-get update
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash
RUN apt-get update -qq && apt-get install -y build-essential nodejs git

RUN mkdir /app
WORKDIR /app

COPY Gemfile /app
COPY Gemfile.lock /app

RUN gem install bundler -v '>= 2.0'
RUN bundle install --without development
COPY . /app

CMD [ "bundle", "exec", "rails", "s" ]
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -415,4 +415,4 @@ DEPENDENCIES
whenever

BUNDLED WITH
1.17.3
2.0.1
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ If you want gate to setup VPN for your, then just install OpenVPN with easy rsa,

> **NOTE** We will be putting some more effort to automate VPN setup using Gate as well. Or you can start creating pull request to help us with this.
#### Run on docker
* Build the docker image using `docker build -t gate .`
* Create and update `.env` file according to `.env.example` with appropriate values
* Run the image using `docker run -p 3000:3000 --env-file=.env -it gate`

### Modules
* pam_gate - for Linux/Unix
* nss_gate - for Linux Name Service Switch
Expand Down
4 changes: 2 additions & 2 deletions config/application.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GATE_HOSTED_DOMAIN: ''
GATE_SERVER_URL: ''
GATE_CONFIG_SECRET: ''
GATE_EMAIL_DOMAIN: ''
GATE_HOSTED_DOMAINS: 'go-jek.com'
GATE_HOSTED_DOMAINS: ''
USER_ROLES: 'employee,consultant'
PRODUCT_LIST: ''
CACHE_PORT: ''
Expand All @@ -16,5 +16,5 @@ GATE_DB_PASSWORD: ''
DEFAULT_HOST_PATTERN: 's*'
UID_BUFFER: 5000
SAML_APPS: 'datadog'
GATE_URL: 'https://gate.gojek.co.id/'
GATE_URL: ''
SIGN_IN_TYPE: ''

0 comments on commit 1ed67f6

Please sign in to comment.