Sign inSign up

gerardnico/dockiql

By gerardnico

•Updated over 8 years ago

GraphiQL in Docker

Image
0

148

gerardnico/dockiql repository overview

⁠DockiQL

⁠About

GraphiQL⁠ in Docker.

⁠Security Concerns

As you are going to use a browser, you wil hit the Cross Origin Resource Sharing (CORS)⁠ problem. Ie the browser by default does not allow you to make a request to another domain if this domain does not allow it.

There is actually four solutions:

  • use ChromeIql⁠ (for Php debugging⁠, you can set it to all request and open or close the debug listener in the IDE)
  • put the public⁠ directory on the same web server than your application (and then don't use this image)
  • disable web security when starting your browser. Example for chrome:
chromium-browser --disable-web-security --user-data-dir
  • allow the request by configuring your server with the CORS headers. Example for the whole www directory:
<Directory /var/www/>
	<IfModule mod_headers.c>
      Header set Access-Control-Allow-Origin "http://graphiql"
      Header set Access-Control-Allow-Headers "Content-Type"
      Header set Access-Control-Allow-Credentials "true"
    </IfModule>
</Directory>

⁠Docker command, if you want to

⁠Get DockiQL

Start DockiQL without modifying the code:

docker run \
    --name DockiQL \
    -p 70:80 \
    --rm \
    gerardnico/dockiql:1.0.0
⁠Modify DockiQL
  • When you want to develop or modify the code (with cmder⁠ as console)
git clone https://github.com/gerardnico/DockiQL .
MOUNT_POINT=$(cygpath -u $(readlink -f ./public/))
docker run \
   --name DockiQL \
   -p 80:80 \
   --rm \
   --detach \
   --mount type=bind,source=/$MOUNT_POINT,target=/usr/local/apache2/htdocs/ \
   httpd:2.4
⁠Build the docker Image

When you want to build the docker image

docker build -t gerardnico/dockiql:1.0.0 .

⁠Credits

This project was largely inspired by:

Tag summary

Content type

Image

Digest

Size

65.8 MB

Last updated

over 8 years ago

docker pull gerardnico/dockiql