@@ -8,10 +8,14 @@ gcloud compute instances create graphql \
88 --boot-disk-size=20GB \
99 --boot-disk-type=pd-standard \
1010 --network-interface=network=default,subnet=default \
11- --tags=http-server, https-server \
11+ --tags=https-server \
1212 --metadata=startup-script=' #!/bin/bash
1313set -euo pipefail
1414
15+ if [ -f /root/done ]; then
16+ exit 0
17+ fi
18+
1519if [ ! -f /swapfile ]; then
1620 fallocate -l 1G /swapfile || dd if=/dev/zero of=/swapfile bs=1M count=1024
1721 chmod 600 /swapfile
2226
2327# Update and install prerequisite packages
2428apt-get update
25- apt-get install -y ca-certificates curl gnupg
29+ apt-get install -y ca-certificates curl gnupg make
2630
2731# Add Docker official GPG key and repository
2832install -m 0755 -d /etc/apt/keyrings
@@ -43,5 +47,19 @@ if [ ! -d /root/pokeapi ]; then
4347 git clone https://github.com/PokeAPI/pokeapi.git /root/pokeapi
4448fi
4549
46- touch /tmp/done
50+ curl -L https://raw.githubusercontent.com/hasura/graphql-engine/refs/heads/master/cli/get.sh | bash
51+
52+ cp /root/pokeapi/Resources/nginx/ssl/cache.prod.conf /root/pokeapi/Resources/nginx/ssl/cache.conf
53+ cp /root/pokeapi/Resources/nginx/ssl/ssl.prod.conf /root/pokeapi/Resources/nginx/ssl/ssl.conf
54+
55+ touch /root/done
56+
57+ # cd pokeapi
58+ # vi .env # POSTGRES_PASSWORD HASURA_GRAPHQL_ADMIN_SECRET
59+ # vi Resources/nginx/ssl/cert.cer # With CF gneerated certificate
60+ # vi Resources/nginx/ssl/key.key
61+ # set -a && source .env && set +a
62+ # make start-graphql-prod
63+ # make update-graphql-data-prod
64+ # Update DNS A record on CF with new IP address
4765'
0 commit comments