File tree 5 files changed +71
-0
lines changed
5 files changed +71
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM stackbrew/ubuntu:saucy
2
+ MAINTAINER Richard Kent Jordan <
[email protected] >
3
+
4
+ RUN echo "deb http://archive.ubuntu.com/ubuntu saucy main universe" > /etc/apt/sources.list
5
+ RUN apt-get update
6
+ RUN apt-get upgrade -y
7
+
8
+ RUN apt-get install -y build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config libpq5 libpq-dev libcurl4-gnutls-dev python-software-properties libffi-dev libgdbm-dev nodejs ruby2.0 ruby2.0-dev
9
+ RUN gem update --system
10
+ RUN gem install bundler
11
+
12
+ ADD . /app
13
+
14
+ ENV RAILS_ENV production
15
+ WORKDIR /app
16
+ RUN bundle install --without development test
17
+ RUN rake tmp:create
18
+ RUN rake assets:precompile
19
+
20
+ # Rails (Must set production.rb to serve static assets)
21
+ EXPOSE 3000
22
+ CMD foreman start
23
+
Original file line number Diff line number Diff line change 58
58
59
59
#gem 'spine-rails'
60
60
gem 'smt_rails'
61
+ gem 'unicorn-rails'
62
+ gem 'foreman'
Original file line number Diff line number Diff line change 63
63
rails (~> 3.0 )
64
64
daemons (1.1.9 )
65
65
diff-lcs (1.2.4 )
66
+ dotenv (0.9.0 )
66
67
erubis (2.7.0 )
67
68
eventmachine (1.0.3 )
68
69
execjs (1.4.0 )
75
76
faye-websocket (0.4.7 )
76
77
eventmachine (>= 0.12.0 )
77
78
ffi (1.8.1 )
79
+ foreman (0.63.0 )
80
+ dotenv (>= 0.7 )
81
+ thor (>= 0.13.6 )
78
82
formatador (0.2.4 )
79
83
gherkin (2.12.0 )
80
84
multi_json (~> 1.3 )
112
116
railties (>= 3.0 , < 5.0 )
113
117
thor (>= 0.14 , < 2.0 )
114
118
json (1.8.0 )
119
+ kgio (2.8.1 )
115
120
libv8 (3.11.8.17 )
116
121
listen (1.1.2 )
117
122
rb-fsevent (>= 0.9.3 )
169
174
rake (>= 0.8.7 )
170
175
rdoc (~> 3.4 )
171
176
thor (>= 0.14.6 , < 2.0 )
177
+ raindrops (0.12.0 )
172
178
rake (10.0.4 )
173
179
rb-fsevent (0.9.3 )
174
180
rb-inotify (0.9.0 )
230
236
uglifier (2.1.1 )
231
237
execjs (>= 0.3.0 )
232
238
multi_json (~> 1.0 , >= 1.0.2 )
239
+ unicorn (4.7.0 )
240
+ kgio (~> 2.6 )
241
+ rack
242
+ raindrops (~> 0.7 )
243
+ unicorn-rails (1.1.0 )
244
+ rack
245
+ unicorn
233
246
wirble (0.1.3 )
234
247
xpath (2.0.0 )
235
248
nokogiri (~> 1.3 )
@@ -244,6 +257,7 @@ DEPENDENCIES
244
257
coffee-rails (~> 3.2.1 )
245
258
cucumber-rails
246
259
factory_girl_rails
260
+ foreman
247
261
guard-jasmine
248
262
guard-rspec
249
263
guard-spork
@@ -264,4 +278,5 @@ DEPENDENCIES
264
278
thin
265
279
turn
266
280
uglifier (>= 1.0.3 )
281
+ unicorn-rails
267
282
wirble
Original file line number Diff line number Diff line change
1
+ web : bundle exec unicorn -c config/unicorn.rb
Original file line number Diff line number Diff line change
1
+ # config/unicorn.rb
2
+ rails_env = ENV [ 'RAILS_ENV' ] || 'production'
3
+ rails_root = `pwd` . gsub ( "\n " , "" )
4
+
5
+ worker_processes Integer ( ENV [ "WEB_CONCURRENCY" ] || 3 )
6
+ timeout 15
7
+ preload_app true
8
+ listen 3000
9
+ pid "#{ rails_root } /tmp/pids/unicorn.pid"
10
+ #stderr_path "#{rails_root}/log/unicorn.log"
11
+ #stdout_path "#{rails_root}/log/unicorn.log"
12
+
13
+ before_fork do |server , worker |
14
+ Signal . trap 'TERM' do
15
+ puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
16
+ Process . kill 'QUIT' , Process . pid
17
+ end
18
+
19
+ defined? ( ActiveRecord ::Base ) and
20
+ ActiveRecord ::Base . connection . disconnect!
21
+ end
22
+
23
+ after_fork do |server , worker |
24
+ Signal . trap 'TERM' do
25
+ puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'
26
+ end
27
+
28
+ defined? ( ActiveRecord ::Base ) and
29
+ ActiveRecord ::Base . establish_connection
30
+ end
You can’t perform that action at this time.
0 commit comments