rahrang
How to install only what's necessary when auto-deploying?
Haha thank you thank you, I definitely spent like an hour putting this together to make things as easy for all of us, especially you Brody since I figured it'd be you to help me out given your history as this server's MVP 😆
I eventually figured the custom Dockerfile would be the best option, just needed to confirm haha. Thanks for the advice and all that you do.
11 replies
How to install only what's necessary when auto-deploying?
Also there's Option 5: Use a custom Dockerfile (https://docs.railway.app/guides/dockerfiles) but that's outside my expertise so that'll be fun to figure out.
11 replies
How to install only what's necessary when auto-deploying?
So then I believe my options are:
Option 1: Nope can't do anything about it
Option 2:
Commit the
out
directory from turbo run frontend
to the Github repo, then configure the Root Directory (https://docs.railway.app/guides/builds#build-command) of the frontend
Railway service to use the out
directory. This isn't ideal because (1) I'd have to remember to generate the out
directory before I push to main
, and (2) I commit duplicative deployment-specific code to my Github repo.
Option 3:
I don't know if this is feasible, but I run turbo prune frontend
in a Github Action to generate the out
directory, and then (somehow, IDK if using the Railway CLI in a Github Action is possible/recommended) have the frontend
Railway service use that out
directory.
Option 4: You help me lol.
Thanks in advance for any thoughts/help in figuring this out.11 replies
CDCloudflare Developers
•Created by Acro on 12/27/2023 in #pages-help
Cloudflare Pages + TurboRepo + PNPM
I've got this same issue right now when trying to deploy a Remix app to Cloudflare Pages and I'm stuck between two options which both don't work. I'm also on Build System Version 2.
Option 1:
- Build output directory:
apps/my-remix-app/public
- Root directory: /
(the root of the monorepo)
Cloudflare Pages correctly uses pnpm
to install dependencies and then deploys my app using the specified build directory, but the app doesn't work because the /functions
directory (which Remix needs to actually be able to serve the app) isn't found because Cloudflare Pages is looking for it at /functions
instead of apps/my-remix-app/functions
.
Option 2:
- Build output directory: /public
- Root directory: /apps/my-remix-app
Cloudflare Pages incorrectly uses npm
to install dependencies, which doesn't work because apps/my-remix-app/package.json
has dependencies on other packages in my workspace
which npm
can't resolve because workspace:*
is pnpm
syntax.
Suggested solution
Cloudflare Pages should use the packageManager
property in the root directory's package.json
to determine which package manager to use (in my case, that property looks like "packageManager": "[email protected]"
), and if that property isn't set, use whatever logic currently exists to determine which package manager to use.27 replies