Skip to content

Instantly share code, notes, and snippets.

@yoeven
Last active September 4, 2023 10:55
Show Gist options
  • Save yoeven/4bc5c3228f010835c07139d363389af9 to your computer and use it in GitHub Desktop.
Save yoeven/4bc5c3228f010835c07139d363389af9 to your computer and use it in GitHub Desktop.
Hasura fly.io toml file
#https://fly.io/docs/reference/configuration/
app = "hasura"
primary_region = "sjc" #https://fly.io/docs/reference/regions/
[build]
image = "hasura/graphql-engine:v2.15.2" #update version accordingly
#https://hasura.io/docs/latest/deployment/updating-graphql-engine/
#https://hasura.io/docs/latest/policies/versioning
[env]
HASURA_GRAPHQL_ADMIN_SECRET = "<secret>"
HASURA_GRAPHQL_CORS_DOMAIN = "*" #optional but recommended for production
HASURA_GRAPHQL_DATABASE_URL = "postgresql://<database connection link>" #example db: https://neon.tech/
HASURA_GRAPHQL_DEV_MODE = "true"
HASURA_GRAPHQL_ENABLE_CONSOLE = "true"
HASURA_GRAPHQL_JWT_SECRET = "<auth jwk/jwt secret>"
HASURA_GRAPHQL_UNAUTHORIZED_ROLE = "public"
PORT = "8080"
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = false #put to true if you do not have events such as crons which require the instants to stay up
auto_start_machines = true
min_machines_running = 1 #put to 0 if you do not have events such a crons which require the instants to stay up
[http_service.concurrency] #adjust values accordingly to the scale of your instance (current values are base on a 1x cpu and 2 gb ram)
soft_limit = 200
hard_limit = 250
[[http_service.checks]]
grace_period = "10s"
interval = "60s"
method = "GET"
timeout = "5s"
path = "/healthz"
# **Deployment Steps**
# 1. Run `fly deploy`
# 2. fly scale memory 2048 (Recommended minimum would be 1x CPU, 2GB RAM)
# 3. fly scale show
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment