heroku: Very easy to use PaaS
Try deploying the Deep Learning App deployed on AWS EC2 to previous on heroku ..
Since EC2 is IaaS, it was necessary to install and configure middleware, but with Heroku of PaaS, the same thing can be done in a few lines on the terminal.
mac
$ brew install heroku
ubuntu
$ sudo apt-get install software-properties-common # debian only
$ sudo add-apt-repository "deb https://cli-assets.heroku.com/branches/stable/apt ./"
$ curl -L https://cli-assets.heroku.com/apt/release.key | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install heroku
$ heroku login
Enter your Heroku credentials:
Email: <your-email>
Password: ********
Logged in as <your-email>
$ mkdir heroku-app
$ cd heroku-app
$ pyenv virtualenv 3.6.0 heroku_keras_3.6.0
$ pyenv local heroku_keras_3.6.0
$ echo .python-version >> .gitignore
$ git init
$ pip install tensorflow keras flask h5py
$ pip install gunicorn # web app. server
$ pip freeze > requirements.txt
$ echo python-3.6.0 > runtime.txt
$ echo web: gunicorn app:app --log-file=- > Procfile
#$ heroku local web
$ heroku create <app-name>
$ heroku buildpacks:set heroku/python
$ git add -A
$ git commit -m "deploy heroku"
$ git push heroku master
$ heroku ps:scale web=1
$ heroku open
App: https://msrks-numpred.herokuapp.com
Recommended Posts