This repository has been archived by the owner on Sep 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Adds docker-compose #2
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,52 @@ | ||
# Hasura GraphQL Engine using docker-compose | ||
|
||
## Prerequisites | ||
|
||
- [Docker](https://docs.docker.com/install/) | ||
- [Docker Compose](https://docs.docker.com/compose/install/#install-compose) | ||
|
||
## Deploy | ||
|
||
- Create a docker-compose.yaml file and copy the below configuration into the file. | ||
```yaml | ||
version: '3.6' | ||
services: | ||
postgres: | ||
image: postgres | ||
environment: | ||
- "POSTGRES_PASSWORD:mysecretpassword" | ||
volumes: | ||
- db_data:/var/lib/postgresql/data | ||
raven: | ||
image: hasuranightly/raven:94a0141 | ||
ports: | ||
- "8080:8080" | ||
links: | ||
- "postgres:postgres" | ||
command: > | ||
/bin/sh -c " | ||
sleep 5; | ||
raven --database-url postgres://postgres:mysecretpassword@postgres:5432/postgres serve; | ||
" | ||
volumes: | ||
db_data: | ||
|
||
``` | ||
|
||
- Run `docker-compose up -d` to start the Hasura GraphQL Engine. | ||
|
||
## Configure | ||
|
||
(Assuming you have already executed `hasura init`) | ||
|
||
- Edit `config.yaml` and add `endpoint` | ||
```yaml | ||
endpoint: http://localhost:8080 | ||
``` | ||
|
||
## Console | ||
|
||
Open the console and start exploring APIs / manage tables/views: | ||
```bash | ||
hasura console | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this sleep required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because raven needs to wait for the postgres server to come up. It crashes otherwise. Do you know a better way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it can keep restarting right? Just like with kubernetes. "Eventually" everything will be up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think restarting will happen on docker compose. May be docker stack.
Isn't there a way of mentioning dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a way in the older version, but it isn't available now docker/compose#4305. Now you have to write a wrapper script or something to check whether dependent services are up or not.
https://docs.docker.com/compose/startup-order/