guieiras-dev / codus-crossfit-server

1 stars 1 forks source link

Codus Crossfit Server

Greenkeeper badge

Roadmap

v0.1

v0.2


Simple GraphQL Server with Postgraphile and Docker

  1. Creating Network

    docker network create crossfit

  2. Creating Database

    docker run --name crossfit_db -p 5432:5432 -e POSTGRES_PASSWORD=password --network=crossfit postgres

  3. Seeding Database

    Use Schema file to create tables and relations.

  4. Starting Postgraphile

    docker run -p 5000:5000 --network crossfit graphile/postgraphile --connection postgres://postgres:password@crossfit_db:5432/crossfit --schema public --watch

You can export Postgraphile GraphQL schema using following command:

docker run -p 5000:5000 -v "PATH_TO_HOST:/host" --network crossfit graphile/postgraphile --connection postgres://postgres:password@crossfit_db:5432/crossfit --schema public --export-schema-graphql="/host/schema.gql"