Install dependencies:
$ BUNDLE_WITHOUT=development:test bundle install
$ npm installPrecompile assets:
$ bin/rails assets:precompile RAILS_ENV=productionSetup database:
$ bin/rails db:migrate RAILS_ENV=productionS3 settings
if you use S3 as storage, set several environment variables.
$ export ACTIVE_STORAGE_SERVICE=amazon
$ export AWS_BUCKET=bucket name
$ export AWS_ACCESS_KEY_ID=access key
$ export AWS_SECRET_ACCESS_KEY=secret access key
$ export AWS_REGION=ap-northeast-1Slack integration
if you want to notify logs to a Slack channel.
$ export SLACK_WEBHOOK_URL=https://hooks.slack.com/services/xxx/yyy/zzzRun:
$ export SECRET_KEY_BASE=$(bin/rails secret)
$ export DEVISE_SECRET_KEY=$(bin/rails secret)
$ export OMNIAUTH_GITHUB_CLIENT_ID=Client ID
$ export OMNIAUTH_GITHUB_CLIENT_SECRET=Client Secret
$ export OMNIAUTH_GITHUB_ORGANIZATION="org1 org2" # optional, space-separated for multiple orgs
$ export SUNLINE_HOSTS="sunline.example.com" # recommended, space-separated for multiple hosts
$ bin/rails s -e productionSUNLINE_HOSTS limits the accepted Host / X-Forwarded-Host values. Sunline embeds the request host in the scripts that runners execute, so set it to the host name your runners use. If it is unset, any host is accepted.
and access to http://localhost:3000/
Setup database:
$ bin/rails db:migrate RAILS_ENV=testRun server:
$ bin/devRun tests:
$ bin/rails specRun docker:
$ docker build -t sunline .
$ docker run -p 3000:3000 -e DATABASE_URL="postgresql://user:pass@localhost:5432/sunline_production?host=host.docker.internal" -e RAILS_FORCE_SSL=false -e RAILS_SERVE_STATIC_FILES=true -e SECRET_KEY_BASE=xxx -e DEVISE_SECRET_KEY=xxx -e OMNIAUTH_GITHUB_CLIENT_ID=xxx -e OMNIAUTH_GITHUB_CLIENT_SECRET=xxx sunline