Skip to content

Commit fc0ae33

Browse files
committed
basic kms image
1 parent 46d71bd commit fc0ae33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1130
-5
lines changed

.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.git
22
.dockerignore
3+
log/*
4+
tmp/*
35
Gemfile.lock

.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
2+
#
3+
# If you find yourself ignoring temporary files generated by your text editor
4+
# or operating system, you probably want to add a global ignore instead:
5+
# git config --global core.excludesfile '~/.gitignore_global'
6+
7+
# Ignore bundler config.
8+
/.bundle
9+
10+
# Ignore all logfiles and tempfiles.
11+
/log/*
12+
/tmp/*
13+
!/log/.keep
14+
!/tmp/.keep
15+
16+
# Ignore Byebug command history file.
17+
.byebug_history

Dockerfile

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1-
FROM ruby:latest
2-
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev postgresql-client nodejs --fix-missing --no-install-recommends
1+
FROM ruby:alpine
2+
MAINTAINER Igor Petrov <[email protected]>
3+
ENV LIBV8_VERSION 3.16.14.18
4+
RUN apk update && apk --update --no-cache add libstdc++ postgresql-client
35
ENV INSTALL_PATH /kms
46
RUN mkdir $INSTALL_PATH
57
WORKDIR $INSTALL_PATH
68

79
COPY Gemfile Gemfile
810

9-
RUN bundle install --without development test
11+
RUN apk --update --no-cache add --virtual build-deps build-base python postgresql-dev nodejs g++; \
12+
#gem install libv8 -v ${LIBV8_VERSION} && \
13+
#gem install therubyracer && \
14+
bundle config build.libv8 --enable-debug && \
15+
LIBV8_VERSION=$LIBV8_VERSION bundle install --without development test && apk del build-deps
1016

1117
COPY . .
1218

1319
# Set Rails to run in production
1420
ENV RAILS_ENV production
1521
ENV RACK_ENV production
1622

17-
RUN DB_ADAPTER=nulldb bundle exec rails assets:precompile
23+
RUN SECRET_TOKEN="$(bundle exec rails secret)" DB_ADAPTER=nulldb bundle exec rails assets:precompile
1824

1925
EXPOSE 3000
2026

2127
# Expose a volume so that nginx will be able to read in assets in production.
2228
VOLUME ["$INSTALL_PATH/public"]
2329

24-
CMD bundle exec rails s -p 3000
30+
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]

Gemfile

+15
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,20 @@ source 'https://rubygems.org'
44
gem 'rails', '~> 5.0.1'
55
# Use postgresql as the database for Active Record
66
gem 'pg', '~> 0.18'
7+
gem 'puma'
8+
gem "activerecord-nulldb-adapter"
9+
gem 'libv8', "= #{ENV['LIBV8_VERSION']}"
10+
gem 'therubyracer'
711

812
gem "kms"
13+
14+
# Use Uglifier as compressor for JavaScript assets
15+
gem 'uglifier', '>= 1.3.0'
16+
# Use SCSS for stylesheets
17+
gem 'sass-rails', '~> 5.0'
18+
gem 'jquery-rails'
19+
gem "coffee-rails"
20+
gem "turbolinks", "~> 5"
21+
22+
23+
gem 'tzinfo-data'

Gemfile.lock

+209
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
actioncable (5.0.2)
5+
actionpack (= 5.0.2)
6+
nio4r (>= 1.2, < 3.0)
7+
websocket-driver (~> 0.6.1)
8+
actionmailer (5.0.2)
9+
actionpack (= 5.0.2)
10+
actionview (= 5.0.2)
11+
activejob (= 5.0.2)
12+
mail (~> 2.5, >= 2.5.4)
13+
rails-dom-testing (~> 2.0)
14+
actionpack (5.0.2)
15+
actionview (= 5.0.2)
16+
activesupport (= 5.0.2)
17+
rack (~> 2.0)
18+
rack-test (~> 0.6.3)
19+
rails-dom-testing (~> 2.0)
20+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
21+
actionview (5.0.2)
22+
activesupport (= 5.0.2)
23+
builder (~> 3.1)
24+
erubis (~> 2.7.0)
25+
rails-dom-testing (~> 2.0)
26+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
27+
active_model_serializers (0.10.4)
28+
actionpack (>= 4.1, < 6)
29+
activemodel (>= 4.1, < 6)
30+
case_transform (>= 0.2)
31+
jsonapi (= 0.1.1.beta6)
32+
activejob (5.0.2)
33+
activesupport (= 5.0.2)
34+
globalid (>= 0.3.6)
35+
activemodel (5.0.2)
36+
activesupport (= 5.0.2)
37+
activerecord (5.0.2)
38+
activemodel (= 5.0.2)
39+
activesupport (= 5.0.2)
40+
arel (~> 7.0)
41+
activerecord-nulldb-adapter (0.3.6)
42+
activerecord (>= 2.0.0)
43+
activesupport (5.0.2)
44+
concurrent-ruby (~> 1.0, >= 1.0.2)
45+
i18n (~> 0.7)
46+
minitest (~> 5.1)
47+
tzinfo (~> 1.1)
48+
addressable (2.5.0)
49+
public_suffix (~> 2.0, >= 2.0.2)
50+
ancestry (2.2.2)
51+
activerecord (>= 3.0.0)
52+
angular-rails-templates (1.0.2)
53+
railties (>= 4.2, < 6)
54+
sprockets (>= 3.0, < 5)
55+
tilt
56+
arel (7.1.4)
57+
bcrypt (3.1.11)
58+
bower-rails (0.9.2)
59+
builder (3.2.3)
60+
cancancan (1.16.0)
61+
carrierwave (1.0.0)
62+
activemodel (>= 4.0.0)
63+
activesupport (>= 4.0.0)
64+
mime-types (>= 1.16)
65+
case_transform (0.2)
66+
activesupport
67+
commonjs (0.2.7)
68+
concurrent-ruby (1.0.5)
69+
devise (4.2.0)
70+
bcrypt (~> 3.0)
71+
orm_adapter (~> 0.1)
72+
railties (>= 4.1.0, < 5.1)
73+
responders
74+
warden (~> 1.2.3)
75+
dragonfly (1.0.12)
76+
addressable (~> 2.3)
77+
multi_json (~> 1.0)
78+
rack (>= 1.3.0)
79+
erubis (2.7.0)
80+
globalid (0.3.7)
81+
activesupport (>= 4.1.0)
82+
i18n (0.8.1)
83+
jsonapi (0.1.1.beta6)
84+
jsonapi-parser (= 0.1.1.beta3)
85+
jsonapi-renderer (= 0.1.1.beta1)
86+
jsonapi-parser (0.1.1.beta3)
87+
jsonapi-renderer (0.1.1.beta1)
88+
kms (0.8.0)
89+
active_model_serializers
90+
ancestry
91+
angular-rails-templates (~> 1.0.0)
92+
bower-rails (~> 0.9.1)
93+
cancancan (~> 1.9)
94+
carrierwave (~> 1.0.0)
95+
devise
96+
dragonfly (~> 1.0.7)
97+
less-rails
98+
liquor
99+
pg
100+
rails (~> 5.0.0)
101+
russian
102+
slim-rails
103+
textacular (~> 4.0.0)
104+
therubyracer
105+
less (2.6.0)
106+
commonjs (~> 0.2.7)
107+
less-rails (2.8.0)
108+
actionpack (>= 4.0)
109+
less (~> 2.6.0)
110+
sprockets (> 2, < 4)
111+
tilt
112+
libv8 (3.16.14.17)
113+
liquor (1.0.0)
114+
loofah (2.0.3)
115+
nokogiri (>= 1.5.9)
116+
mail (2.6.4)
117+
mime-types (>= 1.16, < 4)
118+
method_source (0.8.2)
119+
mime-types (3.1)
120+
mime-types-data (~> 3.2015)
121+
mime-types-data (3.2016.0521)
122+
mini_portile2 (2.1.0)
123+
minitest (5.10.1)
124+
multi_json (1.12.1)
125+
nio4r (2.0.0)
126+
nokogiri (1.7.0.1)
127+
mini_portile2 (~> 2.1.0)
128+
orm_adapter (0.5.0)
129+
pg (0.19.0)
130+
public_suffix (2.0.5)
131+
puma (3.8.2)
132+
rack (2.0.1)
133+
rack-test (0.6.3)
134+
rack (>= 1.0)
135+
rails (5.0.2)
136+
actioncable (= 5.0.2)
137+
actionmailer (= 5.0.2)
138+
actionpack (= 5.0.2)
139+
actionview (= 5.0.2)
140+
activejob (= 5.0.2)
141+
activemodel (= 5.0.2)
142+
activerecord (= 5.0.2)
143+
activesupport (= 5.0.2)
144+
bundler (>= 1.3.0, < 2.0)
145+
railties (= 5.0.2)
146+
sprockets-rails (>= 2.0.0)
147+
rails-dom-testing (2.0.2)
148+
activesupport (>= 4.2.0, < 6.0)
149+
nokogiri (~> 1.6)
150+
rails-html-sanitizer (1.0.3)
151+
loofah (~> 2.0)
152+
railties (5.0.2)
153+
actionpack (= 5.0.2)
154+
activesupport (= 5.0.2)
155+
method_source
156+
rake (>= 0.8.7)
157+
thor (>= 0.18.1, < 2.0)
158+
rake (12.0.0)
159+
ref (2.0.0)
160+
responders (2.3.0)
161+
railties (>= 4.2.0, < 5.1)
162+
russian (0.6.0)
163+
i18n (>= 0.5.0)
164+
slim (3.0.7)
165+
temple (~> 0.7.6)
166+
tilt (>= 1.3.3, < 2.1)
167+
slim-rails (3.1.1)
168+
actionpack (>= 3.1)
169+
railties (>= 3.1)
170+
slim (~> 3.0)
171+
sprockets (3.7.1)
172+
concurrent-ruby (~> 1.0)
173+
rack (> 1, < 3)
174+
sprockets-rails (3.2.0)
175+
actionpack (>= 4.0)
176+
activesupport (>= 4.0)
177+
sprockets (>= 3.0.0)
178+
temple (0.7.7)
179+
textacular (4.0.1)
180+
activerecord (>= 3.0, < 5.1)
181+
therubyracer (0.12.3)
182+
libv8 (~> 3.16.14.15)
183+
ref
184+
thor (0.19.4)
185+
thread_safe (0.3.6)
186+
tilt (2.0.6)
187+
tzinfo (1.2.2)
188+
thread_safe (~> 0.1)
189+
tzinfo-data (1.2017.2)
190+
tzinfo (>= 1.0.0)
191+
warden (1.2.7)
192+
rack (>= 1.0)
193+
websocket-driver (0.6.5)
194+
websocket-extensions (>= 0.1.0)
195+
websocket-extensions (0.1.2)
196+
197+
PLATFORMS
198+
ruby
199+
200+
DEPENDENCIES
201+
activerecord-nulldb-adapter
202+
kms
203+
pg (~> 0.18)
204+
puma
205+
rails (~> 5.0.1)
206+
tzinfo-data
207+
208+
BUNDLED WITH
209+
1.10.3

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# README
2+
3+
This README would normally document whatever steps are necessary to get the
4+
application up and running.
5+
6+
Things you may want to cover:
7+
8+
* Ruby version
9+
10+
* System dependencies
11+
12+
* Configuration
13+
14+
* Database creation
15+
16+
* Database initialization
17+
18+
* How to run the test suite
19+
20+
* Services (job queues, cache servers, search engines, etc.)
21+
22+
* Deployment instructions
23+
24+
* ...

Rakefile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Add your own tasks in files placed in lib/tasks ending in .rake,
2+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3+
4+
require_relative 'config/application'
5+
6+
Rails.application.load_tasks

app/assets/config/manifest.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//= link_tree ../images
2+
//= link_directory ../javascripts .js
3+
//= link_directory ../stylesheets .css

app/assets/images/.keep

Whitespace-only changes.

app/assets/javascripts/application.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This is a manifest file that'll be compiled into application.js, which will include all the files
2+
// listed below.
3+
//
4+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6+
//
7+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
9+
//
10+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11+
// about supported directives.
12+
//
13+
//= require jquery
14+
//= require jquery_ujs
15+
//= require turbolinks
16+
//= require_tree .

app/assets/javascripts/cable.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Action Cable provides the framework to deal with WebSockets in Rails.
2+
// You can generate new channels where WebSocket features live using the rails generate channel command.
3+
//
4+
//= require action_cable
5+
//= require_self
6+
//= require_tree ./channels
7+
8+
(function() {
9+
this.App || (this.App = {});
10+
11+
App.cable = ActionCable.createConsumer();
12+
13+
}).call(this);

app/assets/javascripts/channels/.keep

Whitespace-only changes.
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* This is a manifest file that'll be compiled into application.css, which will include all the files
3+
* listed below.
4+
*
5+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7+
*
8+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
9+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10+
* files in this directory. Styles in this file should be added after the last require_* statement.
11+
* It is generally better to create a new file per style scope.
12+
*
13+
*= require_tree .
14+
*= require_self
15+
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module ApplicationCable
2+
class Channel < ActionCable::Channel::Base
3+
end
4+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module ApplicationCable
2+
class Connection < ActionCable::Connection::Base
3+
end
4+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class ApplicationController < ActionController::Base
2+
protect_from_forgery with: :exception
3+
end

app/controllers/concerns/.keep

Whitespace-only changes.

app/helpers/application_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module ApplicationHelper
2+
end

app/jobs/application_job.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class ApplicationJob < ActiveJob::Base
2+
end

app/mailers/application_mailer.rb

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class ApplicationMailer < ActionMailer::Base
2+
default from: '[email protected]'
3+
layout 'mailer'
4+
end

0 commit comments

Comments
 (0)