Skip to content

Instantly share code, notes, and snippets.

@devigned
Created May 31, 2017 14:35
Show Gist options
  • Save devigned/e084efdc9acabcd7552ca83c807d54ab to your computer and use it in GitHub Desktop.
Save devigned/e084efdc9acabcd7552ca83c807d54ab to your computer and use it in GitHub Desktop.
Habitat run hook for Rails todo
#!/bin/sh
export GEM_HOME="{{pkg.svc_static_path}}/vendor/bundle/ruby/2.4.0"
export GEM_PATH="$(hab pkg path core/ruby)/lib/ruby/gems/2.4.0:$(hab pkg path core/bundler):$GEM_HOME"
export LD_LIBRARY_PATH="$(hab pkg path core/gcc-libs)/lib"
export RAILS_ENV="production"
export RAILS_SERVE_STATIC_FILES="true"
export SSL_CERT_FILE="$(hab pkg path core/cacerts)/ssl/certs/cacert.pem"
cd {{pkg.svc_static_path}}
exec 2>&1
exec ./bin/rails server -b {{cfg.rails_binding_ip}} -p {{cfg.rails_port}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment