Skip to content

Commit

Permalink
Merge branch 'master' into pg-dump
Browse files Browse the repository at this point in the history
  • Loading branch information
Naramsim authored Jan 22, 2025
2 parents b400fdc + e2950e8 commit 86195f3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
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

0 comments on commit 86195f3

Please sign in to comment.