-
Notifications
You must be signed in to change notification settings - Fork 236
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
0 parents
commit 22980b1
Showing
4 changed files
with
93 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM hasuranightly/raven:c9a69e1 | ||
|
||
CMD raven \ | ||
--database-url $DATABASE_URL \ | ||
serve \ | ||
--server-port $PORT \ | ||
--cors-domain "http://localhost:9695" |
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 |
---|---|---|
@@ -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 | ||
``` |
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 |
---|---|---|
@@ -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" | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build: | ||
docker: | ||
web: Dockerfile |