Skip to content

Commit

Permalink
Merge pull request #2 from 2gis/deploy-to-heroku
Browse files Browse the repository at this point in the history
Deploy to heroku documentation
  • Loading branch information
Vadim committed Oct 9, 2015
2 parents b063b24 + 7cbcdc0 commit 9ff9dcf
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cmd: gunicorn pycd.wsgi --config config.py -b 0.0.0.0:5000
web: gunicorn pycd.wsgi --config config.py -b 0.0.0.0:$PORT
beat: python manage.py celery beat -S djcelery.schedulers.DatabaseScheduler
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
[![Build Status](https://travis-ci.org/2gis/badger-api.svg?branch=master)](https://travis-ci.org/2gis/badger-api)

# Badger-api
# Badger-api [![Build Status](https://travis-ci.org/2gis/badger-api.svg?branch=master)](https://travis-ci.org/2gis/badger-api)
Badger-api is an open source backend service (REST API) for [Badger] (https://github.com/2gis/badger) (AngularJS web UI).

# Installation

### Development version
### Development version | <a href="README_HEROKU.md">Deploy to Heroku</a>

Install dependencies:
```bash
Expand Down
57 changes: 57 additions & 0 deletions README_HEROKU.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Badger-api [![Build Status](https://travis-ci.org/2gis/badger-api.svg?branch=master)](https://travis-ci.org/2gis/badger-api)
Badger-api is an open source backend service (REST API) for [Badger] (https://github.com/2gis/badger) (AngularJS web UI).

# Installation

### <a href="README.md">Development version</a> | Deploy to Heroku

Clone repository:
```bash
git clone https://github.com/2gis/badger-api.git
cd badger-api
```

Create an app on Heroku:
```bash
heroku create appname
```

Install CloudAMQP add-on:
```bash
heroku addons:create cloudamqp
```

Configure you app:
```bash
heroku config | grep CLOUDAMQP_URL
heroku config:set BROKER_URL=amqp://user:pass@ec2.clustername.cloudamqp.com/vhost
heroku config:set CDWS_API_HOSTNAME=appname.herokuapp.com
```

Sync database:
```bash
heroku run python manage.py syncdb
```

Copy worker process from Procfile.dev to Procfile:
```bash
worker: python manage.py celery worker -O fair -l DEBUG
```

Save your changes:
```bash
git add .
git commit -m "save my changes"
```

Deploy app:
```bash
git push heroku master
```

Start processes:
```bash
heroku ps:scale worker=1 beat=1 web=1
```


0 comments on commit 9ff9dcf

Please sign in to comment.