Skip to content

Commit

Permalink
Adds required files
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikvt26 committed Jun 18, 2018
0 parents commit 22980b1
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM hasuranightly/raven:c9a69e1

CMD raven \
--database-url $DATABASE_URL \
serve \
--server-port $PORT \
--cors-domain "http://localhost:9695"
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Hasura GraphQL Engine on Heroku

## Prerequisites

- Heroku CLI
- Heroku Account
- Docker

## Setting up

- Create a Heroku App
```
$ heroku create
Creating app... done, ⬢ thawing-savannah-75305
https://thawing-savannah-75305.herokuapp.com/ | https://git.heroku.com/thawing-savannah-75305.git
```
Note the app name `thawing-savannah-75305` from the command above.
In the next commands, substitute `<app-name>` with `thawing-savannah-75305`

- Create a Heroku Postgres Addon for this app
```bash
$ heroku addons:create heroku-postgresql:hobby-dev -a thawing-savannah-75305
```

## Deploy

- Switch to the `heroku/setup` directory. You should have a `Dockerfile` when you hit `ls`:
```bash
$ ls
Dockerfile README.md
```
- Make sure you're logged in to heroku's container registry:
```
$ heroku container:login
```
- Execute the following commands to deploy
```bash
heroku container:push web -a <app-name>
heroku container:release web -a <app-name>
```
- Check the logs to verify if everything is ok:
```bash
heroku logs -a <app-name>
```

## Configure

(Assuming you have already executed `hasura init`)

- Edit `config.yaml` and add `endpoint` as the Heroku App URL
```yaml
endpoint: https://<app-name>.herokuapp.com
```
## Console
Open the console and start exploring APIs / manage tables/views:
```bash
hasura console
```
23 changes: 23 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "Hasura GraphQL Engine",
"description": "Hasura GraphQL Engine <> heroku",
"keywords": [
"graphql",
"backend",
"heroku",
"graphqlapi"
],
"repository": "https://github.com/karthikvt26/heroku-push",
"formation": {
"web": {
"quantity": 1,
"size": "free"
}
},
"stack": "container",
"addons": [
{
"plan": "heroku-postgresql:hobby-dev"
}
]
}
3 changes: 3 additions & 0 deletions heroku.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build:
docker:
web: Dockerfile

0 comments on commit 22980b1

Please sign in to comment.