Skip to content

Commit 86195f3

Browse files
authored
Merge branch 'master' into pg-dump
2 parents b400fdc + e2950e8 commit 86195f3

File tree

4 files changed

+23
-11
lines changed

4 files changed

+23
-11
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ start-graphql-prod:
140140
down-graphql-prod:
141141
docker container rm $(docker container ls -aq) -f
142142
docker system prune --all --volumes --force
143+
docker volume prune --all --force
143144
sync; echo 3 > /proc/sys/vm/drop_caches
144145

145146
# Nginx doesn't start if upstream graphql-engine is down

Resources/compose/docker-compose-prod-graphql.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ services:
1414
restart: "no"
1515

1616
web:
17-
volumes:
18-
- graphiql:/public-console:ro
17+
depends_on:
18+
graphiql:
19+
condition: service_started
20+
graphql-engine:
21+
condition: service_healthy
1922
logging:
2023
driver: gcplogs
2124

@@ -30,10 +33,9 @@ services:
3033
HASURA_GRAPHQL_EVENTS_HTTP_POOL_SIZE: 10
3134

3235
graphiql:
33-
image: pokeapi/graphiql:1.0.1
34-
command: sh -c 'cp -a /app/static/. /transfer/ && tail -f /etc/passwd'
35-
volumes:
36-
- graphiql:/transfer
36+
image: pokeapi/graphiql:2.0.0
37+
expose:
38+
- 80
3739
depends_on:
3840
- graphql-engine
3941
restart: always

Resources/nginx/nginx.conf

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ http {
4747
server graphql-engine:8080 fail_timeout=0;
4848
}
4949

50+
upstream graphiql_upstream {
51+
server graphiql:80 fail_timeout=0;
52+
}
53+
5054
geo $limit {
5155
default 1;
5256
10.0.0.0/8 0;
@@ -99,15 +103,19 @@ http {
99103
}
100104

101105
location /graphql/console {
102-
alias /public-console;
103-
index index.html;
104-
try_files $uri $uri/ /index.html =405;
106+
proxy_http_version 1.1;
107+
proxy_set_header Upgrade $http_upgrade;
108+
proxy_set_header Connection "upgrade";
109+
proxy_set_header X-Real-IP $remote_addr;
110+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
111+
proxy_set_header Host $http_host;
112+
proxy_pass http://graphiql_upstream/;
105113
}
106114

107115
location /graphql/v1beta {
108116
access_log /dev/stdout pokeapilogformat if=$only_post;
109117
include /ssl/cache.conf*;
110-
limit_req zone=graphqlDefaultLimit burst=100 nodelay;
118+
limit_req zone=graphqlDefaultLimit burst=200 nodelay;
111119
limit_req_status 429;
112120
expires 30m;
113121
add_header Cache-Control "public";

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ services:
5555
ports:
5656
- "8080:8080"
5757
depends_on:
58-
- "db"
58+
db:
59+
condition: service_healthy
5960
restart: always
6061
environment:
6162
HASURA_GRAPHQL_DATABASE_URL: postgres://${POSTGRES_USER:-ash}:${POSTGRES_PASSWORD:-pokemon}@db:5432/${POSTGRES_DB:-pokeapi}

0 commit comments

Comments
 (0)