From 85ebd856eb07bee5f745ed774aa795a64c82ec3e Mon Sep 17 00:00:00 2001 From: restitux Date: Sat, 18 Feb 2023 20:45:18 -0700 Subject: [PATCH] Add graphiql testing workflow (#15) --- docker/Dockerfile.graphiql | 3 ++ docker/docker-compose.yml | 7 ++++ docker/graphiql.conf | 52 ++++++++++++++++++++++++++++ docker/graphiql.html | 70 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 132 insertions(+) create mode 100644 docker/Dockerfile.graphiql create mode 100644 docker/graphiql.conf create mode 100644 docker/graphiql.html diff --git a/docker/Dockerfile.graphiql b/docker/Dockerfile.graphiql new file mode 100644 index 0000000..fc7c918 --- /dev/null +++ b/docker/Dockerfile.graphiql @@ -0,0 +1,3 @@ +FROM nginx:latest +COPY graphiql.html /usr/share/nginx/html/index.html +COPY graphiql.conf /etc/nginx/conf.d/default.conf diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 0969ce2..b47c066 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -22,6 +22,13 @@ services: - POSTGRES_DB=cursorius networks: - cursorius + graphiql: + build: + dockerfile: Dockerfile.graphiql + ports: + - "0.0.0.0:45421:80" + networks: + - cursorius networks: cursorius: diff --git a/docker/graphiql.conf b/docker/graphiql.conf new file mode 100644 index 0000000..d5e9526 --- /dev/null +++ b/docker/graphiql.conf @@ -0,0 +1,52 @@ +upstream backend { + server cursorius-server:45420; +} + +server { + listen 80; + listen [::]:80; + server_name localhost; + + #access_log /var/log/nginx/host.access.log main; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + location /graphql { + proxy_pass http://backend/graphql; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 + # + #location ~ \.php$ { + # proxy_pass http://127.0.0.1; + #} + + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + # + #location ~ \.php$ { + # root html; + # fastcgi_pass 127.0.0.1:9000; + # fastcgi_index index.php; + # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; + # include fastcgi_params; + #} + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + #location ~ /\.ht { + # deny all; + #} +} diff --git a/docker/graphiql.html b/docker/graphiql.html new file mode 100644 index 0000000..81d421f --- /dev/null +++ b/docker/graphiql.html @@ -0,0 +1,70 @@ + + + + + GraphiQL + + + + + + + + + + + +
Loading...
+ + + +