deploy in fly.io with multiple environment

need to deploy client and server even the database for prod and dev or staging
1 Reply
kapa.ai
kapa.ai11h ago
Hi @victor. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To deploy your Wasp app on Fly.io, you can use the Wasp CLI's setup command. This command creates your client and server apps on Fly.io and adds some secrets, but it does not deploy them. The command is as follows:
wasp deploy fly setup <app-name> <region>
wasp deploy fly setup <app-name> <region>
The <app-name> is the name of your app and <region> is the region where your app will be deployed. You can find the available regions here (https://wasp-lang.dev/docs/advanced/deployment/cli#flyio-regions). After running setup, Wasp creates two new files in your project root directory: fly-server.toml and fly-client.toml. You should include these files in your version control. You can edit these files to further configure your Fly deployments. If you want to maintain multiple apps (for example, for different environments like production, staging, and development), you can add the --fly-toml-dir <abs-path> option to point to different directories.
wasp deploy fly setup <app-name> <region> --fly-toml-dir <abs-path>
wasp deploy fly setup <app-name> <region> --fly-toml-dir <abs-path>
Remember to only run setup once per app. If you run it multiple times, it will create unnecessary apps on Fly. For deploying the app, you can use the launch command which runs setup, create-db, and deploy in sequence.
wasp deploy fly launch <app-name> <region>
wasp deploy fly launch <app-name> <region>
If your app requires any other environment variables, you can set them with the --server-secret option:
wasp deploy fly launch my-wasp-app mia --server-secret GOOGLE_CLIENT_ID=<...> --server-secret GOOGLE_CLIENT_SECRET=<...>
wasp deploy fly launch my-wasp-app mia --server-secret GOOGLE_CLIENT_ID=<...> --server-secret GOOGLE_CLIENT_SECRET=<...>
Please refer to the Wasp CLI documentation (https://wasp-lang.dev/docs/advanced/deployment/cli#setup) for more details. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @victor, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
Want results from more Discord servers?
Add your server