GraphiQL in Docker.
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:
chromium-browser --disable-web-security --user-data-dir
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>
Start DockiQL without modifying the code:
docker run \
--name DockiQL \
-p 70:80 \
--rm \
gerardnico/dockiql:1.0.0
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
When you want to build the docker image
docker build -t gerardnico/dockiql:1.0.0 .
This project was largely inspired by:
Content type
Image
Digest
Size
65.8 MB
Last updated
over 8 years ago
docker pull gerardnico/dockiql