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

New graphiql #1195

Merged
merged 5 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ start-graphql-prod:
down-graphql-prod:
docker container rm $(docker container ls -aq) -f
docker system prune --all --volumes --force
docker volume prune --all --force
sync; echo 3 > /proc/sys/vm/drop_caches

# Nginx doesn't start if upstream graphql-engine is down
Expand Down
14 changes: 8 additions & 6 deletions Resources/compose/docker-compose-prod-graphql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ services:
restart: "no"

web:
volumes:
- graphiql:/public-console:ro
depends_on:
graphiql:
condition: service_started
graphql-engine:
condition: service_healthy
logging:
driver: gcplogs

Expand All @@ -30,10 +33,9 @@ services:
HASURA_GRAPHQL_EVENTS_HTTP_POOL_SIZE: 10

graphiql:
image: pokeapi/graphiql:1.0.1
command: sh -c 'cp -a /app/static/. /transfer/ && tail -f /etc/passwd'
volumes:
- graphiql:/transfer
image: pokeapi/graphiql:2.0.0
expose:
- 80
depends_on:
- graphql-engine
restart: always
Expand Down
16 changes: 12 additions & 4 deletions Resources/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ http {
server graphql-engine:8080 fail_timeout=0;
}

upstream graphiql_upstream {
server graphiql:80 fail_timeout=0;
}

geo $limit {
default 1;
10.0.0.0/8 0;
Expand Down Expand Up @@ -99,15 +103,19 @@ http {
}

location /graphql/console {
alias /public-console;
index index.html;
try_files $uri $uri/ /index.html =405;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://graphiql_upstream/;
}

location /graphql/v1beta {
access_log /dev/stdout pokeapilogformat if=$only_post;
include /ssl/cache.conf*;
limit_req zone=graphqlDefaultLimit burst=100 nodelay;
limit_req zone=graphqlDefaultLimit burst=200 nodelay;
limit_req_status 429;
expires 30m;
add_header Cache-Control "public";
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ services:
ports:
- "8080:8080"
depends_on:
- "db"
db:
condition: service_healthy
restart: always
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://${POSTGRES_USER:-ash}:${POSTGRES_PASSWORD:-pokemon}@db:5432/${POSTGRES_DB:-pokeapi}
Expand Down
Loading