Skip to content

Instantly share code, notes, and snippets.

@justin808
Created April 14, 2017 22:13
Show Gist options
  • Save justin808/bd75f4aba6bb775e45f26f56ef9cf826 to your computer and use it in GitHub Desktop.
Save justin808/bd75f4aba6bb775e45f26f56ef9cf826 to your computer and use it in GitHub Desktop.
########################################################################################################################
########################################################################################################################
# run-prod-locally.sh
########################################################################################################################
echo "Only run this once to set your production setup after changing JS assets."
echo "You can run foreman start -f Procfile.local-prod to restart the server without recompiling"
echo "You may want to have your /application.yml and /config/database.yml reflect your development settings for production"
# Run the rake tasks as production
RAILS_ENV=production rake assets:clobber
RAILS_ENV=production rake react_on_rails:assets:clobber
RAILS_ENV=production bundle exec rake assets:precompile
# You only need to run the above tasks if you change JS or CSS files
foreman start -f Procfile.local-prod
########################################################################################################################
########################################################################################################################
# Procfile.prod
########################################################################################################################
# Running app like production, but on local server without SSL
# Be SURE to precompile assets first. See /scripts/run-prod-locally.sh
# NOTE: env is local_production so you can set up an env that is close, but slightly different
# You can also just use "production" if that works.
web: RAILS_ENV=local_production SKIP_SSL=YES bundle exec puma -C config/puma.rb
# Run any other needed processes
# worker: RAILS_ENV=local_production bundle exec sidekiq -c 30 -v -q default -q recommendable -q low
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment