Merge pull request #23 from netzbegruenung/setup-graphql-service

Setup graphql service
This commit is contained in:
lienharc 2020-01-31 22:22:58 +01:00 committed by GitHub
commit ea4cbfee3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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: