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'
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
# 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'
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
# 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:
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
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