-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into issue-1182-cache-update
- Loading branch information
Showing
8 changed files
with
172 additions
and
43 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
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
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
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
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
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,36 @@ | ||
# Hasura GraphQL Engine on Docker with pgAdmin | ||
|
||
This Docker Compose setup runs [Hasura GraphQL Engine](https://github.com/hasura/graphql-engine) along with Postgres and [pgAdmin4](https://www.pgadmin.org/) using `docker-compose`. | ||
|
||
## Pre-requisites | ||
|
||
- [Docker](https://docs.docker.com/install/) | ||
- [Docker Compose](https://docs.docker.com/compose/install/) | ||
|
||
## Usage | ||
|
||
- Clone this repo on a machine where you'd like to deploy graphql engine | ||
- Edit `docker-compose.yaml` and change `PGADMIN_DEFAULT_EMAIL` and `PGADMIN_DEFAULT_PASSWORD` to something secure (default pgAdmin login email/password) default value for above variables are: | ||
- **PGADMIN_DEFAULT_EMAIL:** `[email protected]` | ||
- **PGADMIN_DEFAULT_PASSWORD:** `admin` | ||
- Read more `Environment Variables` here: https://hub.docker.com/r/dpage/pgadmin4/ | ||
- Edit `docker-compose.yaml` and change `HASURA_GRAPHQL_ACCESS_KEY` to something secure | ||
- `docker-compose up -d` | ||
- Navigate to `http://localhost:5050`, login and add a new server with the following parameters: | ||
General - Name: Hasura | ||
Connection - Host: `hasura` | ||
Username: `postgres` | ||
Password: leave empty | ||
|
||
## Important endpoints | ||
|
||
- GraphQL endpoint will be `http://localhost:8080/v1alpha1/graphql` | ||
- Hasura Console will be available on `http://localhost:8080/console` | ||
- pgAdmin will be available on `http://localhost:5050` | ||
|
||
|
||
## Connecting to External Postgres | ||
|
||
If you want to connect to an external/existing postgres database, replace `HASURA_GRAPHQL_DATABASE_URL` in `docker-compose.yaml` with your database url. | ||
|
||
**Note: localhost will resolve to the container ip inside a docker container, not the host ip** |
32 changes: 32 additions & 0 deletions
32
install-manifests/docker-compose-pgadmin/docker-compose.yaml
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,32 @@ | ||
version: '3.6' | ||
services: | ||
postgres: | ||
image: postgres | ||
restart: always | ||
volumes: | ||
- db_data:/var/lib/postgresql/data | ||
pgadmin: | ||
image: dpage/pgadmin4 | ||
restart: always | ||
depends_on: | ||
- postgres | ||
ports: | ||
- 5050:80 | ||
## you can change pgAdmin default username/password with below environment variables | ||
environment: | ||
PGADMIN_DEFAULT_EMAIL: [email protected] | ||
PGADMIN_DEFAULT_PASSWORD: admin | ||
graphql-engine: | ||
image: hasura/graphql-engine:v1.0.0-alpha37 | ||
ports: | ||
- "8080:8080" | ||
depends_on: | ||
- "postgres" | ||
restart: always | ||
environment: | ||
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:@postgres:5432/postgres | ||
HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set to "false" to disable console | ||
## uncomment next line to set an access key | ||
# HASURA_GRAPHQL_ACCESS_KEY: mysecretaccesskey | ||
volumes: | ||
db_data: |
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