fix permissions on the log folder on boot
[discourse_docker.git] / templates / web.template.yml
index 56e8a4176ebbae26c97d8d352efdbe5d035e8de5..d5a33a69f75045abc7060eb241b1e32e7c9bfd73 100644 (file)
@@ -3,10 +3,9 @@ env:
   RAILS_ENV: 'production'
   UNICORN_WORKERS: 3
   UNICORN_SIDEKIQS: 1
-  # slightly less aggressive than "recommendation" but works fine with oobgc
-  RUBY_GC_MALLOC_LIMIT: 40000000
-  # this ensures we have enough heap space to handle a big pile of small reqs
-  RUBY_HEAP_MIN_SLOTS: 800000
+  # this gives us very good cache coverage, 96 -> 99
+  # in practice it is 1-2% perf improvement
+  RUBY_GLOBAL_METHOD_CACHE_SIZE: 131072
 
   DISCOURSE_DB_SOCKET: /var/run/postgresql
   DISCOURSE_DB_HOST:
@@ -50,6 +49,23 @@ run:
 
         # find DISCOURSE_ env vars, strip the leader, lowercase the key
         /usr/local/bin/ruby -e 'ENV.each{|k,v| puts "#{$1.downcase} = #{v}" if k =~ /^DISCOURSE_(.*)/}' > $conf
+  - file:
+     path: /etc/runit/1.d/fix-log-permissions
+     chmod: "+x"
+     contents: |
+       #!/bin/bash
+       # TODO this should be moved into the base image
+       chown -fR www-data:adm /var/log/nginx
+       chown -f syslog:syslog /var/log/syslog*
+       chown -f syslog:syslog /var/log/auth.log*
+       chown -f syslog:adm /var/log/kern.log*
+
+  - file:
+     path: /etc/runit/1.d/enable-brotli
+     chmod: "+x"
+     contents: |
+        #!/bin/bash
+        [ ! -z "$COMPRESS_BROTLI" ] && sed -i "s/. brotli/  brotli/" /etc/nginx/conf.d/discourse.conf || sed -i "s/. brotli/# brotli/" /etc/nginx/conf.d/discourse.conf
 
   - file:
      path: /etc/runit/1.d/ensure-web-nginx-read