a year ago
Build failing from local packages in my monorepo, i have tested build locally it must be ran from root, not sure if Railway does the same or modify things.
ⓘ Deployment information is only viewable by project members and Railway employees.
27 Replies
a year ago
Hello,
Are you able to build with the Dockerfile locally? please confirm that before attempting to have Railway build the Dockerfile.
brody
Hello,Are you able to build with the Dockerfile locally? please confirm that before attempting to have Railway build the Dockerfile.
a year ago
I've tested everything locally, and it works fine. In my Railway project, I have three services running the same Docker setup. However, two of them fail while one succeeds.
The one that works (called "Puzzle") does not require any "compiled package"—meaning it doesn't need a build process like vite build to generate a dist folder. Instead, it only references local packages that contain configuration files. This Docker container runs without issues.
I suspect the problem might be related to Moonrepo and how it interacts with Railway, but I'm not entirely sure. I haven't been able to find anything useful to debug the issue. Any guidance would be appreciated.
a year ago
Hello,
We do not do anything special with the build, can you please confirm if you are able to build with the Dockerfile locally?
brody
Hello,We do not do anything special with the build, can you please confirm if you are able to build with the Dockerfile locally?
a year ago
yes build work locally
a year ago
Sorry I'm not talking about building your application with npm run build - I am talking about building with the Dockerfile.
a year ago
Yes im talking about Dockfile
a year ago
not sure what is that tbh xD
a year ago
What is BuildKit is it like flag or something can't find anything about for some reason
a year ago
One thing to note, since you correctly have the root directory unset, the build is ran from the root of the project, but your Dockerfile copies files in as if the build was ran from within the /apps/platform folder.
brody
One thing to note, since you correctly have the root directory unset, the build is ran from the root of the project, but your Dockerfile copies files in as if the build was ran from within the /apps/platform folder.
a year ago
What does that mean since you correctly have the root directory unset,
brody
There are many great resources on BuildKit out there.
a year ago
also is there any services online that i can use install buildkit seems like hassel can get it working on windows or wsl 2 for some reason
justkira
What does that mean since you correctly have the root directory unset,
a year ago
You do not have a root directory set, in other words, your root directory is unset -
This is not to say that you should set a root directory, you shouldn't set one since you have a shared monorepo, I'm just stating an observation.
Attachments
a year ago
Ok how do i Verify its built with build kit i have followed docker docks it seems i have to just enable feature flag which i did and build work just fine. but nothing is changed soo can't tell if it worked or not
brody
One thing to note, since you correctly have the root directory unset, the build is ran from the root of the project, but your Dockerfile copies files in as if the build was ran from within the /apps/platform folder.
a year ago
Please take what I've said here into consideration.
a year ago
Welp i checked everything maybe, im missing something but when i seen logs they are matching (I Think haven't use docker with that many steps tbh) so not sure if there issue with copying /apps/platform , im follow doc of moonrepo i have deployed it before on Contabo VM but not sure where to look at this point.
a year ago
The Dockerfile build is run from the root of the project when on Railway, but your Dockerfile copies files into the image with a relative path as if the build was run from within the /apps/platform folder.
You need to fix this in your Dockerfile.
a year ago
can't i just do this with custom build force root dir in railwaydocker build -f ./apps/platform/Dockerfile . like that
a year ago
Not if you are using a shared monorepo.
Please take what I've previously said into consideration and adjust your Dockerfile accordingly.
brody
Not if you are using a shared monorepo.Please take what I've previously said into consideration and adjust your Dockerfile accordingly.
a year ago
i was looking for work around i have created new docker file will test it now
a year ago
Well it seems it stopped working can't find moon.yml folder
I have changed COPY . .
to COPY ../../ .
that in theory should fix issue if docker is not running as if its from root but it seems from this test no to was running from root i assume
a year ago
Got it fixed after 22 hours
The issue was actually in the Moon repo itself, which I didn't expect. I'm running Windows, and the scripts function a bit differently here, which made the build work even though it doesn't make sense since Docker should be running on Linux. Anyway, I fixed it by adjusting my Moon repo config. Sorry for the hassle!
Status changed to Solved brody • about 1 year ago
