-
-
Save kevinmcalear/a3a2ac130ac62eecee46434e35403ca0 to your computer and use it in GitHub Desktop.
Entrypoint script (Photo Album on Google Cloud Run)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cd /usr/src/app | |
# Create the Rails production DB on first run | |
RAILS_ENV=production bundle exec rake db:create | |
# Make sure we are using the most up to date | |
# database schema | |
RAILS_ENV=production bundle exec rake db:migrate | |
# Do some protective cleanup | |
> log/production.log | |
rm -f tmp/pids/server.pid | |
# Run the web service on container startup | |
# $PORT is provided as an environment variable by Cloud Run | |
bundle exec rails server -e production -b 0.0.0.0 -p $PORT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment