Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dockerfile
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:alpine
LABEL description="A GraphQL API created by reflection over a PostgreSQL schmea https://github.com/postgraphql/postgraphql"

# alpine linux standard doesn't include bash, and postgraphql scripts have #! bash
RUN apk add --update bash && rm -rf /var/cache/apk/*

RUN mkdir -p /postgraphql
WORKDIR /postgraphql

COPY . /postgraphql

RUN npm install
RUN scripts/build
RUN npm pack
RUN npm install -g postgraphql-*.tgz

RUN rm -rf /postgraphql
EXPOSE 5000
ENTRYPOINT ["postgraphql", "-n", "0.0.0.0"]
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ createServer(postgraphql())

For more information around using PostGraphQL as a library, and the options the API expects read the [library usage documentation article](https://github.com/calebmer/postgraphql/blob/master/docs/library.md).

There is also a docker image for running PostGraphQL maintained by @angelosarto, simply pass the same options to the docker container:

```bash
docker pull postgraphql/postgraphql
docker run postgraphql/postgraphql --help
```

To connect to a database and expose the PostGraphQL port try this:

```bash
docker run -p 5000:5000 postgraphql/postgraphql --connection postgres://POSTGRES_USER:POSTGRES_PASSWORD@POSTGRES_HOST:POSTGRES_PORT/POSTGRES_SCHEMA
```

Also make sure to check out the **[forum example][]** and especially **[step by step tutorial][]** for a demo of a PostGraphQL compliant schema and authentication.

[forum example]: https://github.com/calebmer/postgraphql/tree/master/examples/forum
Expand Down