Skip to content

Commit 572a563

Browse files
mnlboxshahidhk
authored andcommitted
add docker-compose-pgadmin manifest (close #1424) (#1494)
1 parent ad72984 commit 572a563

File tree

3 files changed

+74
-3
lines changed

3 files changed

+74
-3
lines changed

install-manifests/README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ Various installation / deployment methods for Hasura GraphQL Engine
44

55
1. [Docker Compose](docker-compose)
66
2. [Docker Compose with HTTPS using Caddy](docker-compose-https)
7-
3. [Docker run](docker-run)
8-
3. [Kubernetes](kubernetes)
9-
7+
3. [Docker Compose with PostGIS enabled Postgres](docker-compose-postgis)
8+
4. [Docker Compose with pgAdmin](docker-compose-pgadmin)
9+
5. [Docker run](docker-run)
10+
6. [Kubernetes](kubernetes)
11+
7. [Azure Container Instance without Postgres](azure-container)
12+
8. [Azure Container Instances with Postgres](azure-container-with-pg)
1013

1114
## License
1215

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Hasura GraphQL Engine on Docker with pgAdmin
2+
3+
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`.
4+
5+
## Pre-requisites
6+
7+
- [Docker](https://docs.docker.com/install/)
8+
- [Docker Compose](https://docs.docker.com/compose/install/)
9+
10+
## Usage
11+
12+
- Clone this repo on a machine where you'd like to deploy graphql engine
13+
- 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:
14+
- **PGADMIN_DEFAULT_EMAIL:** `[email protected]`
15+
- **PGADMIN_DEFAULT_PASSWORD:** `admin`
16+
- Read more `Environment Variables` here: https://hub.docker.com/r/dpage/pgadmin4/
17+
- Edit `docker-compose.yaml` and change `HASURA_GRAPHQL_ACCESS_KEY` to something secure
18+
- `docker-compose up -d`
19+
- Navigate to `http://localhost:5050`, login and add a new server with the following parameters:
20+
General - Name: Hasura
21+
Connection - Host: `hasura`
22+
Username: `postgres`
23+
Password: leave empty
24+
25+
## Important endpoints
26+
27+
- GraphQL endpoint will be `http://localhost:8080/v1alpha1/graphql`
28+
- Hasura Console will be available on `http://localhost:8080/console`
29+
- pgAdmin will be available on `http://localhost:5050`
30+
31+
32+
## Connecting to External Postgres
33+
34+
If you want to connect to an external/existing postgres database, replace `HASURA_GRAPHQL_DATABASE_URL` in `docker-compose.yaml` with your database url.
35+
36+
**Note: localhost will resolve to the container ip inside a docker container, not the host ip**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: '3.6'
2+
services:
3+
postgres:
4+
image: postgres
5+
restart: always
6+
volumes:
7+
- db_data:/var/lib/postgresql/data
8+
pgadmin:
9+
image: dpage/pgadmin4
10+
restart: always
11+
depends_on:
12+
- postgres
13+
ports:
14+
- 5050:80
15+
## you can change pgAdmin default username/password with below environment variables
16+
environment:
17+
PGADMIN_DEFAULT_EMAIL: [email protected]
18+
PGADMIN_DEFAULT_PASSWORD: admin
19+
graphql-engine:
20+
image: hasura/graphql-engine:v1.0.0-alpha37
21+
ports:
22+
- "8080:8080"
23+
depends_on:
24+
- "postgres"
25+
restart: always
26+
environment:
27+
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:@postgres:5432/postgres
28+
HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set to "false" to disable console
29+
## uncomment next line to set an access key
30+
# HASURA_GRAPHQL_ACCESS_KEY: mysecretaccesskey
31+
volumes:
32+
db_data:

0 commit comments

Comments
 (0)