Deploying applications built on Gel Cloud to Fly.io
-
Install the Fly.io CLI
-
Log in to Fly.io with
flyctl auth login
-
Run
flyctl launch
to create a new app on Fly.io and configure it. It will ask you to select a region and a name for your app. When done it will create afly.toml
file and aDockerfile
in your project directory. -
Set
GEL_INSTANCE
andGEL_SECRET_KEY
as secrets in your Fly.io app.For runtime secrets, you can do this by running the following commands:
Copy$
flyctl secrets set GEL_INSTANCE <GEL_INSTANCE>
Copy$
flyctl secrets set GEL_SECRET_KEY <GEL_SECRET_KEY>
Read more about Fly.io runtime secrets.
For build secrets, you can do this by modifying the
Dockerfile
to mount the secrets as environment variables.DockerfileCopy# Build application RUN pnpm run build RUN \ GEL_INSTANCE="$(cat /run/secrets/GEL_INSTANCE)" \ GEL_SECRET_KEY="$(cat /run/secrets/GEL_SECRET_KEY)" \ pnpm run build
-
Deploy your app to Fly.io
Copy$
flyctl deploy
If your app requires build secrets, you can pass them as arguments to the
deploy
command:Copy$
flyctl deploy --build-secret GEL_INSTANCE="<GEL_INSTANCE>" \ --build-secret GEL_SECRET_KEY="<GEL_SECRET_KEY>"