Skip to content
Snippets Groups Projects
  • Daniel Hunsaker's avatar
    5bf4838e
    [nanobox] Minor tweaks for 1.5 (#4395) · 5bf4838e
    Daniel Hunsaker authored
    - Be less strict about the Ruby version, which resolves a build failure.
    - Add libidn as a dependency (until Nanobox adds idn-ruby to the list of gems with a dependency on it).
    - Remove redundant bundler commands (Nanobox's Ruby engine handles these things cleanly on its own, now).
    5bf4838e
    History
    [nanobox] Minor tweaks for 1.5 (#4395)
    Daniel Hunsaker authored
    - Be less strict about the Ruby version, which resolves a build failure.
    - Add libidn as a dependency (until Nanobox adds idn-ruby to the list of gems with a dependency on it).
    - Remove redundant bundler commands (Nanobox's Ruby engine handles these things cleanly on its own, now).
boxfile.yml 5.92 KiB
run.config:
  engine: ruby
  engine.config:
    runtime: ruby-2.4

  extra_packages:
    # basic servers:
    - nginx
    - nodejs

    # for images:
    - ImageMagick

    # for videos:
    - ffmpeg3

    # to prep the .env file:
    - gettext-tools

    # for node-gyp, used in the asset compilation process:
    - python-2

    # i18n:
    - libidn

  cache_dirs:
    - node_modules

  extra_path_dirs:
    - node_modules/.bin

  build_triggers:
    - .ruby-version
    - Gemfile
    - Gemfile.lock
    - package.json
    - yarn.lock

  extra_steps:
    - envsubst < .env.nanobox > .env
    - yarn

  fs_watch: true

deploy.config:
  extra_steps:
    - NODE_ENV=production bundle exec rake assets:precompile
  transform:
    - "sed 's/LOCAL_HTTPS=.*/LOCAL_HTTPS=true/i' /app/.env.nanobox | envsubst > /app/.env.production"
    - |-
        if [ -z "$LOCAL_DOMAIN" ]
        then
          . /app/.env.production
          export LOCAL_DOMAIN
        fi
        erb /app/nanobox/nginx-web.conf.erb > /app/nanobox/nginx-web.conf
        erb /app/nanobox/nginx-stream.conf.erb > /app/nanobox/nginx-stream.conf
    - touch /app/log/production.log
  before_live:
    web.web:
      - bundle exec rake db:migrate:setup

web.web:
  start:
    nginx: nginx -c /app/nanobox/nginx-web.conf
    rails: bundle exec puma -C /app/config/puma.rb

  routes:
    - '/'