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 launchto 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.tomlfile and aDockerfilein your project directory. -
Set
GEL_INSTANCEandGEL_SECRET_KEYas 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
Dockerfileto 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 deployIf your app requires build secrets, you can pass them as arguments to the
deploycommand:Copy$
flyctl deploy --build-secret GEL_INSTANCE="<GEL_INSTANCE>" \ --build-secret GEL_SECRET_KEY="<GEL_SECRET_KEY>"