From 66909417adcec53a739fb3c3b57d59cd843870ec Mon Sep 17 00:00:00 2001 From: Angelo Sarto Date: Mon, 26 Jun 2017 19:48:18 -0500 Subject: [PATCH 01/11] (feat) Docker Image --- Dockerfile | 12 ++++++++++++ README.md | 8 ++++++++ 2 files changed, 20 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..fb7c8fed02 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node +LABEL description="A simple container for running postgraphql postgraphq://github.com/postgraphql/postgraphql.git" + +WORKDIR / +RUN git clone https://github.com/postgraphql/postgraphql.git +WORKDIR /postgraphql +RUN npm install +RUN scripts/build +RUN npm pack +RUN npm install -g postgraphql-*.tgz +EXPOSE 5000 +ENTRYPOINT ["postgraphql", "-n", "0.0.0.0"] diff --git a/README.md b/README.md index 7da1127e16..b2bfb43bce 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,14 @@ For information about how to change these defaults, just run: postgraphql --help ``` +There is also a docker image for running PostGraphQL, simply pass the same options to the docker container: +```bash +docker pull postgraphql\postgraphql +docker run postgraphql --help +# or +docker run -p 5000:5000 postgraphql --connection postgres://POSTGRES_USER:POSTGRES_PASSWORD@POSTGRES_HOST:POSTGRES_PORT/POSTGRES_SCHEMA +``` + You can also use PostGraphQL as native HTTP, Connect, Express, or Koa middleware. Just import `postgraphql`: ```js From 0ea298f3cbd44f2404e427b4ad49d6f553d0f4f6 Mon Sep 17 00:00:00 2001 From: Angelo Sarto Date: Mon, 26 Jun 2017 19:48:18 -0500 Subject: [PATCH 02/11] (feat) Docker Image --- Dockerfile | 12 ++++++++++++ README.md | 8 ++++++++ 2 files changed, 20 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..fb7c8fed02 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node +LABEL description="A simple container for running postgraphql postgraphq://github.com/postgraphql/postgraphql.git" + +WORKDIR / +RUN git clone https://github.com/postgraphql/postgraphql.git +WORKDIR /postgraphql +RUN npm install +RUN scripts/build +RUN npm pack +RUN npm install -g postgraphql-*.tgz +EXPOSE 5000 +ENTRYPOINT ["postgraphql", "-n", "0.0.0.0"] diff --git a/README.md b/README.md index 7da1127e16..b2bfb43bce 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,14 @@ For information about how to change these defaults, just run: postgraphql --help ``` +There is also a docker image for running PostGraphQL, simply pass the same options to the docker container: +```bash +docker pull postgraphql\postgraphql +docker run postgraphql --help +# or +docker run -p 5000:5000 postgraphql --connection postgres://POSTGRES_USER:POSTGRES_PASSWORD@POSTGRES_HOST:POSTGRES_PORT/POSTGRES_SCHEMA +``` + You can also use PostGraphQL as native HTTP, Connect, Express, or Koa middleware. Just import `postgraphql`: ```js From a7957c854a6bcaa0ea9b731817bc30c951b8930d Mon Sep 17 00:00:00 2001 From: Angelo Sarto Date: Wed, 28 Jun 2017 07:42:09 -0500 Subject: [PATCH 03/11] (feat) Docker Image --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b2bfb43bce..4f4d75d53d 100644 --- a/README.md +++ b/README.md @@ -41,10 +41,12 @@ postgraphql --help There is also a docker image for running PostGraphQL, simply pass the same options to the docker container: ```bash -docker pull postgraphql\postgraphql -docker run postgraphql --help -# or -docker run -p 5000:5000 postgraphql --connection postgres://POSTGRES_USER:POSTGRES_PASSWORD@POSTGRES_HOST:POSTGRES_PORT/POSTGRES_SCHEMA +docker pull postgraphql/postgraphql +docker run postgraphql/postgraphql --help +``` +To connect to a database and expose the graphql port try this: +```bash +docker run -p 5000:5000 postgraphql/postgraphql --connection postgres://POSTGRES_USER:POSTGRES_PASSWORD@POSTGRES_HOST:POSTGRES_PORT/POSTGRES_SCHEMA ``` You can also use PostGraphQL as native HTTP, Connect, Express, or Koa middleware. Just import `postgraphql`: From 809c0b377095989b6ec46527bfe397b46fa53166 Mon Sep 17 00:00:00 2001 From: Angelo Sarto Date: Wed, 28 Jun 2017 08:05:05 -0500 Subject: [PATCH 04/11] (feat) Docker Image --- Dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index fb7c8fed02..fa5a989efe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,6 @@ FROM node -LABEL description="A simple container for running postgraphql postgraphq://github.com/postgraphql/postgraphql.git" +LABEL description="A GraphQL API created by reflection over a PostgreSQL schmea https://github.com/postgraphql/postgraphql" -WORKDIR / -RUN git clone https://github.com/postgraphql/postgraphql.git -WORKDIR /postgraphql RUN npm install RUN scripts/build RUN npm pack From 888d7560aaddee710bf54177b5ed5bd7fcdfb447 Mon Sep 17 00:00:00 2001 From: Angelo Sarto Date: Wed, 28 Jun 2017 08:12:52 -0500 Subject: [PATCH 05/11] (feat) Docker Image --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index fa5a989efe..ac7ba02f6c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,5 +5,6 @@ RUN npm install RUN scripts/build RUN npm pack RUN npm install -g postgraphql-*.tgz +RUN rm -rf node_modules EXPOSE 5000 ENTRYPOINT ["postgraphql", "-n", "0.0.0.0"] From b83c2a7f5767a58eaab5bb75fbe2593422ed9377 Mon Sep 17 00:00:00 2001 From: Angelo Sarto Date: Wed, 28 Jun 2017 08:35:44 -0500 Subject: [PATCH 06/11] (feat) Docker Image --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index ac7ba02f6c..755035ffd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM node LABEL description="A GraphQL API created by reflection over a PostgreSQL schmea https://github.com/postgraphql/postgraphql" +COPY . RUN npm install RUN scripts/build RUN npm pack From 6081384415b16e8f7a1ecbe1c1c6d0b57cd4d3af Mon Sep 17 00:00:00 2001 From: Angelo Sarto Date: Wed, 28 Jun 2017 13:11:36 -0500 Subject: [PATCH 07/11] (feat) Docker Image --- Dockerfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 755035ffd9..ac9da55700 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,17 @@ FROM node LABEL description="A GraphQL API created by reflection over a PostgreSQL schmea https://github.com/postgraphql/postgraphql" -COPY . +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 node_modules +RUN rm -rf build EXPOSE 5000 ENTRYPOINT ["postgraphql", "-n", "0.0.0.0"] From 5505d1092cbdea8f1688faa315e7c6a4efe756ad Mon Sep 17 00:00:00 2001 From: Angelo Sarto Date: Sat, 1 Jul 2017 09:16:03 -0500 Subject: [PATCH 08/11] (feat) Docker Image --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ac9da55700..88c8a7b3d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node +FROM node:alpine LABEL description="A GraphQL API created by reflection over a PostgreSQL schmea https://github.com/postgraphql/postgraphql" RUN mkdir -p /postgraphql From 020297bca3a954ad98a9f29d63231c47a15cf716 Mon Sep 17 00:00:00 2001 From: Angelo Sarto Date: Sat, 1 Jul 2017 10:44:29 -0500 Subject: [PATCH 09/11] (feat) Docker Image --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 88c8a7b3d2..e7eb0cdfab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ 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 @@ -11,7 +14,6 @@ RUN scripts/build RUN npm pack RUN npm install -g postgraphql-*.tgz -RUN rm -rf node_modules -RUN rm -rf build +RUN rm -rf /postgraphql EXPOSE 5000 ENTRYPOINT ["postgraphql", "-n", "0.0.0.0"] From 93498a6db9f7f39c9f99995792dc35bd03f1c9ed Mon Sep 17 00:00:00 2001 From: Angelo Sarto Date: Sat, 1 Jul 2017 13:11:24 -0500 Subject: [PATCH 10/11] (feat) Docker Image --- .dockerignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..94143827ed --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +Dockerfile From 72ab94cab12981ba92b0ff70744e08f29d2650c1 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Sun, 9 Jul 2017 20:27:51 +0100 Subject: [PATCH 11/11] Tweak Docker mention in README. --- README.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4f4d75d53d..718a575acc 100644 --- a/README.md +++ b/README.md @@ -39,16 +39,6 @@ For information about how to change these defaults, just run: postgraphql --help ``` -There is also a docker image for running PostGraphQL, 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 graphql port try this: -```bash -docker run -p 5000:5000 postgraphql/postgraphql --connection postgres://POSTGRES_USER:POSTGRES_PASSWORD@POSTGRES_HOST:POSTGRES_PORT/POSTGRES_SCHEMA -``` - You can also use PostGraphQL as native HTTP, Connect, Express, or Koa middleware. Just import `postgraphql`: ```js @@ -60,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