diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..e5452e1a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +/log/* +!/log/.keep +/tmp +.idea +.env +*.swp +config/application.yml +public/assets/* +dump.rdb +coverage +.git diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..3b213293 --- /dev/null +++ b/.env.example @@ -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= diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..b48ebc33 --- /dev/null +++ b/Dockerfile @@ -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" ] diff --git a/Gemfile.lock b/Gemfile.lock index 738a04d2..b54b7023 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -415,4 +415,4 @@ DEPENDENCIES whenever BUNDLED WITH - 1.17.3 + 2.0.1 diff --git a/README.md b/README.md index 64fc3d1f..98226485 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/config/application.yml.sample b/config/application.yml.sample index e14a1eb4..bda191de 100644 --- a/config/application.yml.sample +++ b/config/application.yml.sample @@ -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: '' @@ -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: ''