running graphQL instance in compose file

This commit is contained in:
Pit-Storm 2019-11-02 18:24:59 +01:00
parent 795d6567b1
commit e1c8b38d0f
5 changed files with 40 additions and 5 deletions

5
.env
View file

@ -1,2 +1,5 @@
COMPOSE_FILE=docker-compose.dev.yml
COMPOSE_PROJECT_NAME=candymat
COMPOSE_PROJECT_NAME=candymat
#Postgraphile vars
DATABASE_URL=postgres://candymat:postgres!dev@postgres:5432/candymat_db

View file

@ -10,4 +10,8 @@
git submodule init
git submodule update
```
### Start backend
* ```docker-compose up -d```
* Point browser to http://localhost:5000/graphiql for testing queries and documentation of nodes and http://localhost:5000/graphql for graphQL endpoint

View file

@ -1,4 +1,4 @@
POSTGRES_PASSWORD=postgres!dev
POSTGRES_USER=candymat
POSTGRES_DB=candymat_db
POSTGRES_SCHEMA=candymat_data
POSTGRES_SCHEMA=candymat_data

View file

@ -13,5 +13,19 @@ services:
networks:
- backend
graphql:
restart: always
image: graphile/postgraphile
depends_on:
- postgres
env_file: ./backend/.env-backend
ports:
- "5000:5000"
command: ["postgraphile", "--connection", $DATABASE_URL, "--host", "0.0.0.0", "--port", "5000", "--schema", "candymat_data", "--watch"]
networks:
- frontend
- backend
networks:
backend:
backend:
frontend:

View file

@ -15,7 +15,21 @@ services:
networks:
- backend
graphql:
restart: always
image: graphile/postgraphile
depends_on:
- postgres
env_file: ./backend/.env-backend
ports:
- "5000:5000"
command: ["postgraphile", "--connection", $DATABASE_URL, "--host", "0.0.0.0", "--port", "5000", "--schema", "candymat_data", "--watch"]
networks:
- frontend
- backend
networks:
backend:
columes:
frontend:
volumes:
db-data: