env:
  MIGRATE_ON_BOOT: 1
  PRECOMPILE_ON_BOOT: 1
  CREATE_DB_ON_BOOT: 1

params:
  offline_page_repository: https://github.com/discourse/discourse-offline-page.git

run:
  - file:
     path: "/etc/nginx/conf.d/outlets/server/30-offline-page.conf"
     contents: |
        error_page 502 /error_page.html;
        location /error_page.html {
          root /var/www/discourse-offline-page/html;
          internal;
        }

  - exec:
      cmd: git clone $offline_page_repository /var/www/discourse-offline-page
      raise_on_fail: false
