404 main page not found

I deployed a docker file that contains multiple services and express app that serves react is one of them. When I try to access the main webpage, I get 404 with following logs in the deployment
Error: ENOENT: no such file or directory, stat '/usr/src/app/noodle/build/index.html'
Error: ENOENT: no such file or directory, stat '/usr/src/app/noodle/build/index.html'
Error: ENOENT: no such file or directory, stat '/usr/src/app/noodle/build/index.html'
Error: ENOENT: no such file or directory, stat '/usr/src/app/noodle/build/index.html'
I tried to set the Caddyfile and nixpacks.toml files based on this repo here https://github.com/brody192/vite-react-template/blob/main/nixpacks.toml to no luck https://popspace-demo-production.up.railway.app/
GitHub
vite-react-template/nixpacks.toml at main · brody192/vite-react-tem...
Contribute to brody192/vite-react-template development by creating an account on GitHub.
9 Replies
Percy
Percy3mo ago
Project ID: N/A
Brody
Brody3mo ago
are you able to share your repo?
IamIconLiving
IamIconLiving3mo ago
sure, here it is https://github.com/OlegGulevskyy/popspace-demo it's a fork from this basically https://github.com/with-labs/popspace the ui package from my understanding is here https://github.com/OlegGulevskyy/popspace-demo/tree/master/noodle and that's where I placed the files
Brody
Brody3mo ago
looks like you are using the wrong caddyfile and nixpacks.toml combo - https://github.com/brody192/create-react-app-starter use the files from this repo. and make sure you have the root directory set to /noodle in your service settings.
IamIconLiving
IamIconLiving3mo ago
ah that's true, I can see in Caddyfile I was pointing to dist folder, that's gotta be causing some troubles at the very least gonna try now hm, without setting /noodle as a root directory leads to the same issue but with setting /noodle as a root directory I am getting a bunch of errors
2.350 warning Resolution field "babel-loader@8.1.0" is incompatible with requested version "babel-loader@^8.2.2"

4.356 error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.

4.356 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

-----



Dockerfile:26

-------------------

24 | ENV NIXPACKS_PATH /app/node_modules/.bin:$NIXPACKS_PATH

25 | COPY . /app/.

26 | >>> RUN --mount=type=cache,id=s/17269ca0-4835-43a2-8593-0fdab0c1c387-/root/cache/Cypress,target=/root/.cache/Cypress --mount=type=cache,id=s/17269ca0-4835-43a2-8593-0fdab0c1c387-/usr/local/share/cache/yarn/v6,target=/usr/local/share/.cache/yarn/v6 yarn install --frozen-lockfile

27 |

28 | # build phase

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c yarn install --frozen-lockfile" did not complete successfully: exit code: 1



Error: Docker build failed
2.350 warning Resolution field "babel-loader@8.1.0" is incompatible with requested version "babel-loader@^8.2.2"

4.356 error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.

4.356 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

-----



Dockerfile:26

-------------------

24 | ENV NIXPACKS_PATH /app/node_modules/.bin:$NIXPACKS_PATH

25 | COPY . /app/.

26 | >>> RUN --mount=type=cache,id=s/17269ca0-4835-43a2-8593-0fdab0c1c387-/root/cache/Cypress,target=/root/.cache/Cypress --mount=type=cache,id=s/17269ca0-4835-43a2-8593-0fdab0c1c387-/usr/local/share/cache/yarn/v6,target=/usr/local/share/.cache/yarn/v6 yarn install --frozen-lockfile

27 |

28 | # build phase

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c yarn install --frozen-lockfile" did not complete successfully: exit code: 1



Error: Docker build failed
not actually sure where the RUN is from that "causes" the error, it's Railway's docker file?
Brody
Brody3mo ago
you need the root directory to be set to /noodle since that's the app you are trying to deploy, you'll need to deploy all the app's separately your lock file needs to be updated
IamIconLiving
IamIconLiving3mo ago
i am back on this topic, the issue is that when using suggested Caddy files and nix toml it brings a lot of problems during deployment that I am not sure I am able to solve, when I am getting Not found, at least I am able to build the project fine and I can see that the logs are normal, like the deployment is happening https://popspace-demo-production.up.railway.app/ however, I also have couple of other ports that are supposed to be available - backend, and none of them are responsive for example
curl https://popspace-demo-production.up.railway.app:8889/media_providers
curl https://popspace-demo-production.up.railway.app:8889/media_providers
so it seems like there is a bigger problem than just UI not rendering correctly, none of my services are not working at all
No description
No description
IamIconLiving
IamIconLiving3mo ago
whereas I tried to deploy it Fly.io and I got opposite almsot 😄 I get the UI working but the backends impossible to make work well actually I cannot even deploy separately these services, when I try to deploy the UI service, it errors out while trying to import other serivces, because it's trying to find them in the global registry instead of from workspace
Brody
Brody3mo ago
you can't access specific ports, you need to deploy each app individually and noodle comes with its own server, so you don't even need the Caddyfile and nixpacks.toml