Deploy keys
Hey all. Quick question. I've been using Convex with Fly.io for hosting. It works great. But I realized I don't really understand why it's working since I never set the CONVEX_DEPLOY_KEY environment variable in the fly Docker container. My workflow is simple, I just deploy convex, build locally (%npm run build). Copy the Vite dist/ files to a public/ directory. And then roll all that into a Fly Docker image.
My concern is that the access token was rolled into the production .js files. Is there anyway to verify this? I have a bare bones project on Github (https://github.com/61cygni/flyconv-pixi) and here is it running on Fly.io (https://falling-star-8336.fly.dev/)
GitHub
GitHub - 61cygni/flyconv-pixi: Bare bones convex / pixi / fly configs
Bare bones convex / pixi / fly configs. Contribute to 61cygni/flyconv-pixi development by creating an account on GitHub.
7 Replies
Hi Martin! The deploy key is only needed to push code to the Convex deployment. If you're running
npx convex deploy
from your terminal before rolling the docker container, it's using your local auth (from npx convex login
stored in ~/.convex/config.json
) to push the Convex functions. The docker container won't contain any credentials.Perfect, thank you!
@casado if you're manually doing
npx convex deploy
right now, you might want to look into npx convex dev
soon. it will auto-deploy your code as it changes into a separate development instance of your backend. that way you can iterate on your project without mucking around with the deployed production app's data. then you can npx convex deploy
as part of CI or your manual release process when you're happy with your changesI do! I use npx convex dev for all local development. I only run deploy just prior to building the website with vite and then Dockerizing and shipping to fly.
ah okay, then you're already set. perfect!
The big problem is that it's too easy.
I honestly just Vite'd the site, Dockerized it, launched on Fly.io and everything just worked.
well, great! that's the goal 😉