File tree Expand file tree Collapse file tree 4 files changed +61
-0
lines changed Expand file tree Collapse file tree 4 files changed +61
-0
lines changed Original file line number Diff line number Diff line change @@ -12,3 +12,13 @@ gem 'rack-throttle'
12
12
group :development do
13
13
gem 'mechanize'
14
14
end
15
+
16
+ group :production do
17
+ gem 'unicorn'
18
+
19
+ # Enable gzip compression on heroku, but don't compress images.
20
+ gem 'heroku-deflater'
21
+
22
+ # Heroku injects it if it's not in there already
23
+ gem 'rails_12factor'
24
+ end
Original file line number Diff line number Diff line change 59
59
formtastic (2.2.1 )
60
60
actionpack (>= 3.0 )
61
61
has_scope (0.5.1 )
62
+ heroku-deflater (0.2.0 )
62
63
hoptoad_notifier (2.4.11 )
63
64
activesupport
64
65
builder
73
74
actionpack (>= 3.0.0 )
74
75
activesupport (>= 3.0.0 )
75
76
railties (>= 3.0.0 )
77
+ kgio (2.8.1 )
76
78
mail (2.2.19 )
77
79
activesupport (>= 2.3.6 )
78
80
i18n (>= 0.4.0 )
@@ -111,12 +113,18 @@ GEM
111
113
activesupport (= 3.0.10 )
112
114
bundler (~> 1.0 )
113
115
railties (= 3.0.10 )
116
+ rails_12factor (0.0.2 )
117
+ rails_serve_static_assets
118
+ rails_stdout_logging
119
+ rails_serve_static_assets (0.0.1 )
120
+ rails_stdout_logging (0.0.3 )
114
121
railties (3.0.10 )
115
122
actionpack (= 3.0.10 )
116
123
activesupport (= 3.0.10 )
117
124
rake (>= 0.8.7 )
118
125
rdoc (~> 3.4 )
119
126
thor (~> 0.14.4 )
127
+ raindrops (0.12.0 )
120
128
rake (0.9.2 )
121
129
rdoc (3.9.4 )
122
130
responders (0.6.5 )
129
137
polyglot
130
138
polyglot (>= 0.3.1 )
131
139
tzinfo (0.3.29 )
140
+ unicorn (4.7.0 )
141
+ kgio (~> 2.6 )
142
+ rack
143
+ raindrops (~> 0.7 )
132
144
warden (1.2.1 )
133
145
rack (>= 1.0 )
134
146
webrobots (0.0.11 )
@@ -140,10 +152,13 @@ PLATFORMS
140
152
DEPENDENCIES
141
153
activeadmin (= 0.5.0 )
142
154
faker
155
+ heroku-deflater
143
156
hoptoad_notifier (= 2.4.11 )
144
157
mechanize
145
158
newrelic_rpm (= 3.1.1 )
146
159
nifty-generators
147
160
rack-throttle
148
161
rails (= 3.0.10 )
162
+ rails_12factor
149
163
sqlite3-ruby
164
+ unicorn
Original file line number Diff line number Diff line change
1
+ web : bundle exec unicorn -p $PORT -c ./config/unicorn.rb
Original file line number Diff line number Diff line change
1
+ # config/unicorn.rb
2
+
3
+ worker_processes 3
4
+ timeout 30
5
+ preload_app true
6
+
7
+ before_fork do |server , worker |
8
+ # Replace with MongoDB or whatever
9
+ if defined? ( ActiveRecord ::Base )
10
+ ActiveRecord ::Base . connection . disconnect!
11
+ Rails . logger . info ( 'Disconnected from ActiveRecord' )
12
+ end
13
+
14
+ # If you are using Redis but not Resque, change this
15
+ if defined? ( Resque )
16
+ Resque . redis . quit
17
+ Rails . logger . info ( 'Disconnected from Redis' )
18
+ end
19
+
20
+ sleep 1
21
+ end
22
+
23
+ after_fork do |server , worker |
24
+ # Replace with MongoDB or whatever
25
+ if defined? ( ActiveRecord ::Base )
26
+ ActiveRecord ::Base . establish_connection
27
+ Rails . logger . info ( 'Connected to ActiveRecord' )
28
+ end
29
+
30
+ # If you are using Redis but not Resque, change this
31
+ if defined? ( Resque )
32
+ Resque . redis = ENV [ 'REDIS_URI' ]
33
+ Rails . logger . info ( 'Connected to Redis' )
34
+ end
35
+ end
You can’t perform that action at this time.
0 commit comments