Update web.template.yml
[discourse_docker.git] / templates / web.template.yml
index 7918e95e217a676f04a3b3d8f904d5d8e2834bb8..c094b7acf98ec849d7ea9a5b95048e9955e61aca 100644 (file)
@@ -18,7 +18,7 @@ params:
   version: tests-passed
 
   home: /var/www/discourse
-  upload_size: 3m
+  upload_size: 10m
 
 run:
   - exec: /usr/local/bin/ruby -e 'if ENV["DISCOURSE_SMTP_ADDRESS"] == "smtp.example.com"; puts "Aborting! Mail is not configured!"; exit 1; end'
@@ -54,6 +54,20 @@ run:
         mkdir -p /var/log/nginx
         exec /usr/sbin/nginx
 
+  - file:
+     path: /etc/runit/3.d/01-nginx
+     chmod: "+x"
+     contents: |
+       #!/bin/bash
+       sv stop nginx
+
+  - file:
+     path: /etc/runit/3.d/02-unicorn
+     chmod: "+x"
+     contents: |
+       #!/bin/bash
+       sv stop unicorn
+
   - exec:
       cd: $home
       hook: code
@@ -113,6 +127,11 @@ run:
         # ensure we are on latest bundler
         - gem update bundler
         - chown -R discourse $home
+
+  - exec:
+      cd: $home
+      hook: bundle_exec
+      cmd:
         - su discourse -c 'bundle install --deployment --verbose --without test --without development'
         - su discourse -c 'bundle exec rake db:migrate'
         - su discourse -c 'bundle exec rake assets:precompile'
@@ -122,7 +141,7 @@ run:
      chmod: +x
      contents: |
        #!/bin/bash
-       (cd /var/www/discourse && RAILS_ENV=production sudo -E -u discourse bundle exec script/discourse "$@")
+       (cd /var/www/discourse && RAILS_ENV=production sudo -H -E -u discourse bundle exec script/discourse "$@")
 
   - file:
      path: /usr/local/bin/rails
@@ -132,9 +151,9 @@ run:
        # If they requested a console, load pry instead
        if [ "$@" == "c" -o "$@" == "console" ]
        then
-        (cd /var/www/discourse && RAILS_ENV=production sudo -E -u discourse bundle exec pry -r ./config/environment)
+        (cd /var/www/discourse && RAILS_ENV=production sudo -H -E -u discourse bundle exec pry -r ./config/environment)
        else
-        (cd /var/www/discourse && RAILS_ENV=production sudo -E -u discourse bundle exec script/rails "$@")
+        (cd /var/www/discourse && RAILS_ENV=production sudo -H -E -u discourse bundle exec script/rails "$@")
        fi
 
   - file:
@@ -142,7 +161,7 @@ run:
      chmod: +x
      contents: |
        #!/bin/bash
-       (cd /var/www/discourse && RAILS_ENV=production sudo -E -u discourse bundle exec bin/rake "$@")
+       (cd /var/www/discourse && RAILS_ENV=production sudo -H -E -u discourse bundle exec bin/rake "$@")
 
   - file:
      path: /etc/update-motd.d/10-web
@@ -169,6 +188,17 @@ run:
                 sv 1 unicorn
                 endscript
         }
+
+  - replace:
+      filename: "/etc/logrotate.d/nginx"
+      from: "weekly"
+      to: "daily"
+
+  - replace:
+      filename: "/etc/logrotate.d/nginx"
+      from: "52"
+      to: "14"
+
   # move state out of the container this fancy is done to support rapid rebuilds of containers,
   # we store anacron and logrotate state outside the container to ensure its maintained across builds
   # later move this snipped into an intialization script