Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) Docker Image #496

Merged
merged 14 commits into from
Jul 9, 2017
Merged

(feat) Docker Image #496

merged 14 commits into from
Jul 9, 2017

Conversation

angelosarto
Copy link
Collaborator

This PR creates a ready-to-use docker container for postgraphql. It is a minimal docker container based on the generic 'node:alpine' image. The Alpine linux version was used here to make the resulting image smaller (the standard node image is 265MB, alpine is is 22MB). Including postgraphql and dependencies the total image is 102MB.

I have added instructions to the readme on how to retrieve the image from docker hub as well as how to run it. Basically you pass the postgraphql command line options to the docker image the same as if you were running it locally. It does not include postgres as this is meant to be a standalone, ready-to-use production container of postgraphql.
(I will create some examples of how to run it along with a dockerized postgres in a later PR to either the documentation site and/or to the examples/doc folders.)

Dockerhub will store the docker image for people to retrieve the pre-built postgraphql image. I have created an account named postgraphql that will own the postgraphql image. In order to setup automated docker builds we need to link github with dockerhub to trigger the docker builds. After approving this PR, someone will need to login to dockerhub as postgraphql and

In DockerHub logged in as postgraphql

  1. Click on the profile drop down (upper right corner)
  2. Choose Settings
  3. Click on Linked Accounts and Services
  4. Click on Link GItHub
  5. Choose either of the linking options

In GIthub logged in as postgraphql

  1. Go to the repo settings
  2. Click on Integrations and Services
  3. Click on Add Service and find 'Docker'
  4. Click Add Service

Then I can delete and re-setup the automated docker build and make it public or I can send more instructions.

@benjie
Copy link
Member

benjie commented Jul 2, 2017

Failing, not your fault, because:

npm ERR! peerinvalid The package graphql@0.10.3 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer graphiql@0.9.1 wants graphql@^0.6.0 || ^0.7.0 || ^0.8.0-b || ^0.9.0

This probably affects master too.

@benjie
Copy link
Member

benjie commented Jul 2, 2017

Thanks for doing this, @angelosarto, I'll get back to you in the next week. If I don't, please feel free to give me a nudge.

@benjie benjie mentioned this pull request Jul 9, 2017
Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved the docker mention below the library section and mentioned that the Docker build is maintained by you 🙏

@benjie benjie merged commit 886f875 into graphile:master Jul 9, 2017
@benjie
Copy link
Member

benjie commented Jul 9, 2017

Hi @angelosarto; I've now completed the above instructions - back to you. Are you happy being in charge of Docker for this project?

@angelosarto
Copy link
Collaborator Author

@benjie sounds good. I will maintain the dockerhub. I will login today and make it public and make sure the builds can be pulled publicly.

@benjie
Copy link
Member

benjie commented Jul 11, 2017

Awesome, thanks!

@angelosarto
Copy link
Collaborator Author

@benjie I think you linked the docker account to your github account -- so when I build from docker it is grabbing benjie/postgraphql Could you delete the github link and link it to postgraphql git account instead so it points at postgraphql/postgraphql?

@benjie
Copy link
Member

benjie commented Jul 11, 2017

The PostGraphQL GitHub "account" is an organization - I don't think you can log in as it to Docker hub?

I added the Docker integration to postgraphql/postgraphql; I'm not sure why it would be looking at benjie/postgraphql?

@angelosarto
Copy link
Collaborator Author

angelosarto commented Jul 25, 2017

@benjie Sorry for the delay -- had an issue with a production deployment at the day-job that consumed a bunch of time. I am just checking back into this now.

In Github can you check under "settings" the "Authorized OAuth Apps" section then click on the name "Docker Hub Registry" there should be a heading for "Organization access" and if not yet granted to the postgraphql organization there should be a "Grant button"

If you don't see a section called Organization Access. I think this is because it requires "Public and Private" link from docker hub.

  1. Login to hub.docker.com using postgraphql
  2. Go to {profile dropdown} - > settings.
  3. Go to Linked Accounts & Services
  4. UNLINK your github account
  5. RE-Link the git hub account and choose Public and Private
  6. It should pop up a github window Authorize Application, In this window there will be Organizations Access section with a list of your orgs -- click "Grant" next to postgraphql then click "Authorize Docker"

@benjie
Copy link
Member

benjie commented Jul 25, 2017

@angelosarto Great; done - let me know if it worked 👍

@benjie
Copy link
Member

benjie commented Jul 25, 2017

(I had to use a different GitHub account because some of my old contracting clients do not have Third Party app security enabled and I don't want to grant access to their repos - I don't think this should cause you any problems but just letting you know.)

@angelosarto
Copy link
Collaborator Author

@benjie Perfect - the docker images are all up and working! I should have some time to submit new docs to the doc site for running docker versions of postgraphql

@benjie
Copy link
Member

benjie commented Jul 26, 2017

Awesome, thanks @angelosarto!

@meglio
Copy link

meglio commented Nov 27, 2017

Is a Docker image planned for Graphile (= graphql v4)?

Also, an example using with docker-compose and combining with PostgreSQL docker image would be very useful. Should I create a separate issue asking about usage in docker-compose?

@benjie
Copy link
Member

benjie commented Nov 27, 2017

Open another issue 👍

This may help: #636 (comment)

Belline pushed a commit to Belline/postgraphql that referenced this pull request Dec 18, 2017
* (feat) Docker Image

* (feat) Docker Image

* (feat) Docker Image

* (feat) Docker Image

* (feat) Docker Image

* (feat) Docker Image

* (feat) Docker Image

* (feat) Docker Image

* (feat) Docker Image

* (feat) Docker Image

* Tweak Docker mention in README.
@angelosarto
Copy link
Collaborator Author

@meglio
replying to this old comment -- I think with postgraphile supporting npx and aws lambda. I am not sure that there will be much of a use case for docker image. npx takes care of quick and dirty local and running direct in a lambda takes care of a lot as well.

If I am wrong - I think adding it to graphile should be pretty trivial - its near the same dockerfile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants