I’m currently working on a project where my WebSockets server is contained within my client application, but for deployment purposes, I only want to deploy the server to Fly.io. I’d like to keep both the client and server in the same repository for development convenience but ensure that only the WebSockets server is deployed.
My Setup:
- Monorepo-style project: Client (React/Next.js) and WebSockets server (Node.js with WebSockets).
- Fly.io deployment: I only want to deploy the WebSockets server and not the client.
What I Need Help With:
- How can I configure
fly.toml
or my deployment commands so that only the server directory gets deployed? - Should I use a
[build]
section infly.toml
to specify the working directory? - Are there any
flyctl
commands that allow me to push just the server while keeping everything else in the same repo? - Any best practices for keeping both together in development while ensuring a clean deployment?
Would appreciate any insights or examples from folks who have tackled a similar setup!