boxfile.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. run.config:
  2. engine: ruby
  3. engine.config:
  4. runtime: ruby-2.4.1
  5. extra_packages:
  6. # basic servers:
  7. - nginx
  8. - nodejs
  9. # for images:
  10. - ImageMagick
  11. # for videos:
  12. - ffmpeg3
  13. # to prep the .env file:
  14. - gettext-tools
  15. # for node-gyp, used in the asset compilation process:
  16. - python-2
  17. cache_dirs:
  18. - node_modules
  19. extra_path_dirs:
  20. - node_modules/.bin
  21. build_triggers:
  22. - .ruby-version
  23. - Gemfile
  24. - Gemfile.lock
  25. - package.json
  26. - yarn.lock
  27. extra_steps:
  28. - envsubst < .env.nanobox > .env
  29. - gem install bundler
  30. - bundle config build.nokogiri --with-iconv-dir=/data/ --with-zlib-dir=/data/
  31. - bundle config build.nokogumbo --with-iconv-dir=/data/ --with-zlib-dir=/data/
  32. - bundle install --clean
  33. - yarn
  34. fs_watch: true
  35. deploy.config:
  36. extra_steps:
  37. - NODE_ENV=production bundle exec rake assets:precompile
  38. transform:
  39. - "sed 's/LOCAL_HTTPS=.*/LOCAL_HTTPS=true/i' /app/.env.nanobox | envsubst > /app/.env.production"
  40. - |-
  41. if [ -z "$LOCAL_DOMAIN" ]
  42. then
  43. . /app/.env.production
  44. export LOCAL_DOMAIN
  45. fi
  46. erb /app/nanobox/nginx-web.conf.erb > /app/nanobox/nginx-web.conf
  47. erb /app/nanobox/nginx-stream.conf.erb > /app/nanobox/nginx-stream.conf
  48. - touch /app/log/production.log
  49. before_live:
  50. web.web:
  51. - bundle exec rake db:migrate:setup
  52. web.web:
  53. start:
  54. nginx: nginx -c /app/nanobox/nginx-web.conf
  55. rails: bundle exec puma -C /app/config/puma.rb
  56. routes:
  57. - '/'
  58. writable_dirs:
  59. - tmp
  60. log_watch:
  61. rails: 'log/production.log'
  62. network_dirs:
  63. data.storage:
  64. - public/system
  65. web.stream:
  66. start:
  67. nginx: nginx -c /app/nanobox/nginx-stream.conf
  68. node: yarn run start
  69. routes:
  70. - '/api/v1/streaming*'
  71. # Somehow we're getting requests for scheme://domain//api/v1/streaming* - match those, too
  72. - '//api/v1/streaming*'
  73. writable_dirs:
  74. - tmp
  75. worker.sidekiq:
  76. start: bundle exec sidekiq -c 5 -q default -q mailers -q pull -q push -L /app/log/sidekiq.log
  77. writable_dirs:
  78. - tmp
  79. log_watch:
  80. rails: 'log/production.log'
  81. sidekiq: 'log/sidekiq.log'
  82. network_dirs:
  83. data.storage:
  84. - public/system
  85. cron:
  86. - id: generate_static_gifs
  87. schedule: '*/15 * * * *'
  88. command: 'bundle exec rake mastodon:maintenance:add_static_avatars'
  89. - id: update_counter_caches
  90. schedule: '50 * * * *'
  91. command: 'bundle exec rake mastodon:maintenance:update_counter_caches'
  92. # runs feeds:clear, media:clear, users:clear, and push:refresh
  93. - id: do_daily_tasks
  94. schedule: '00 00 * * *'
  95. command: 'bundle exec rake mastodon:daily'
  96. - id: clear_silenced_media
  97. schedule: '10 00 * * *'
  98. command: 'bundle exec rake mastodon:media:remove_silenced'
  99. - id: clear_remote_media
  100. schedule: '20 00 * * *'
  101. command: 'bundle exec rake mastodon:media:remove_remote'
  102. - id: clear_unfollowed_subs
  103. schedule: '30 00 * * *'
  104. command: 'bundle exec rake mastodon:push:clear'
  105. - id: send_digest_emails
  106. schedule: '00 20 * * *'
  107. command: 'bundle exec rake mastodon:emails:digest'
  108. # The following two tasks can be uncommented to automatically open and close
  109. # registrations on a schedule. The format of 'schedule' is a standard cron
  110. # time expression: minute hour day month day-of-week; search for "cron
  111. # time expressions" for more info on how to set these up. The examples here
  112. # open registration only from 8 am to 4 pm, server time.
  113. #
  114. # - id: open_registrations
  115. # schedule: '00 08 * * *'
  116. # command: 'bundle exec rake mastodon:settings:open_registrations'
  117. #
  118. # - id: close_registrations
  119. # schedule: '00 16 * * *'
  120. # command: 'bundle exec rake mastodon:settings:close_registrations'
  121. data.db:
  122. image: nanobox/postgresql:9.5
  123. data.redis:
  124. image: nanobox/redis:3.0
  125. data.storage:
  126. image: nanobox/unfs:0.9