Sha256: 4e056c98853d7ed256280042016fcd86dd6b8cbd19c98e1441cb361542fda860

Contents?: true

Size: 1 KB

Versions: 36

Compression:

Stored size: 1 KB

Contents

# configure nginx and passenger
COPY <<-'EOF' /etc/nginx/sites-enabled/default
server {
    listen 3000;
    root /rails/public;
    passenger_enabled on;
<% if options['max-idle'] -%>
    passenger_ctl hook_detached_process /etc/nginx/hook_detached_process;
    passenger_min_instances 0;
    passenger_pool_idle_time <%= max_idle %>;
<% end -%>
}
EOF
<% if options['max-idle'] -%>
COPY <<-'EOF' /etc/nginx/sites-enabled/hook_detached_process
#!/usr/bin/env ruby
status = `passenger-status`
processes = status[/^Processes\s*:\s*(\d*)/, 1].to_i
system 'nginx -s stop' if processes == 0
EOF
<% end -%>
RUN echo "daemon off;" >> /etc/nginx/nginx.conf && \
    sed -i 's/access_log\s.*;/access_log stdout;/' /etc/nginx/nginx.conf && \
    sed -i 's/error_log\s.*;/error_log stderr info;/' /etc/nginx/nginx.conf && \
<% if options['max-idle'] -%>
    chmod +sx /etc/nginx/sites-enabled/hook_detached_process && \
<% end -%>
    sed -i 's/user www-data/user rails/' /etc/nginx/nginx.conf && \
    mkdir /var/run/passenger-instreg

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
dockerfile-rails-1.7.2 lib/generators/templates/_passenger.erb
dockerfile-rails-1.7.1 lib/generators/templates/_passenger.erb
dockerfile-rails-1.7.0 lib/generators/templates/_passenger.erb
dockerfile-rails-1.6.25 lib/generators/templates/_passenger.erb
dockerfile-rails-1.6.24 lib/generators/templates/_passenger.erb
dockerfile-rails-1.6.23 lib/generators/templates/_passenger.erb
dockerfile-rails-1.6.22 lib/generators/templates/_passenger.erb
dockerfile-rails-1.6.21 lib/generators/templates/_passenger.erb
dockerfile-rails-1.6.20 lib/generators/templates/_passenger.erb
dockerfile-rails-1.6.19 lib/generators/templates/_passenger.erb
dockerfile-rails-1.6.18 lib/generators/templates/_passenger.erb
dockerfile-rails-1.6.17 lib/generators/templates/_passenger.erb
dockerfile-rails-1.6.16 lib/generators/templates/_passenger.erb
dockerfile-rails-1.6.15 lib/generators/templates/_passenger.erb
dockerfile-rails-1.6.10 lib/generators/templates/_passenger.erb
dockerfile-rails-1.6.9 lib/generators/templates/_passenger.erb
dockerfile-rails-1.6.8 lib/generators/templates/_passenger.erb
dockerfile-rails-1.6.7 lib/generators/templates/_passenger.erb
dockerfile-rails-1.6.6 lib/generators/templates/_passenger.erb
dockerfile-rails-1.6.5 lib/generators/templates/_passenger.erb