forked from StephenGrider/ReduxCasts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a1686e2
commit 2620706
Showing
1 changed file
with
10 additions
and
63 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,15 @@ | ||
# ruby-getting-started | ||
# Blog API | ||
|
||
A barebones Rails app, which can easily be deployed to Heroku. | ||
Run this locally if you want to have your own blog server. | ||
|
||
This application support the [Getting Started with Ruby on Heroku](https://devcenter.heroku.com/articles/getting-started-with-ruby) article - check it out. | ||
|
||
## Running Locally | ||
|
||
Make sure you have Ruby installed. Also, install the [Heroku Toolbelt](https://toolbelt.heroku.com/). | ||
|
||
```sh | ||
$ git clone [email protected]:heroku/ruby-getting-started.git | ||
$ cd ruby-getting-started | ||
$ bundle install | ||
$ bundle exec rake db:create db:migrate | ||
$ heroku local | ||
Setup | ||
----- | ||
In the project root, run the following: | ||
``` | ||
|
||
Your app should now be running on [localhost:5000](http://localhost:5000/). | ||
|
||
## Deploying to Heroku | ||
|
||
```sh | ||
$ heroku create | ||
$ git push heroku master | ||
$ heroku run rake db:migrate | ||
$ heroku open | ||
bundle | ||
rake db:create | ||
rake db:migrate | ||
rails s | ||
``` | ||
|
||
or | ||
|
||
[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy) | ||
|
||
## Docker | ||
|
||
The app can be run and tested using the [Heroku Docker CLI plugin](https://devcenter.heroku.com/articles/introduction-local-development-with-docker). | ||
|
||
Make sure the plugin is installed: | ||
|
||
heroku plugins:install heroku-docker | ||
|
||
Configure Docker and Docker Compose: | ||
|
||
heroku docker:init | ||
|
||
And run the app locally: | ||
|
||
docker-compose up web | ||
|
||
The app will now be available on the Docker daemon IP on port 8080. | ||
|
||
To work with the local database and do migrations, you can open a shell: | ||
|
||
docker-compose run shell | ||
bundle exec rake db:migrate | ||
|
||
You can also use Docker to release to Heroku: | ||
|
||
heroku create | ||
heroku docker:release | ||
heroku open | ||
|
||
## Documentation | ||
|
||
For more information about using Ruby on Heroku, see these Dev Center articles: | ||
|
||
- [Ruby on Heroku](https://devcenter.heroku.com/categories/ruby) | ||
|
||
And away you go! |