R
Railway

✋|help

Build a node pack inside and then run .js file outside

Rrageoffire4/5/2023
Anyone know how to to build a package inside a folder like this folder1/folder2/package.json and then run a index.js in root folder
PPercy4/5/2023
Project ID: fd98a4cb-a823-467e-b701-d42af92842f9
Rrageoffire4/5/2023
fd98a4cb-a823-467e-b701-d42af92842f9
BBrody4/5/2023
can i see your repo so i can understand this better?
Rrageoffire4/6/2023
where can I share it ? It a private source code I buy from a person
BBrody4/6/2023
you can send it here, no one here is gonna do anything bad
Rrageoffire4/6/2023
Here is my project (I have delete some files in it)
Jjackson4/6/2023
there's nothing in there
Rrageoffire4/6/2023
exastly my main point is to deploy project to railway and run npm install inside Server/Core/Server and then go outside to execute node index.js
BBrody4/6/2023
Dockerfile
AAdam4/6/2023
You can send it to me, I can review Won't share it If you delete files it will be near impossible to help you
Rrageoffire4/6/2023
I have send you a source You mean I can generation my own dockerfile right ?
AAdam4/6/2023
Thank you, I'll take a look
Rrageoffire4/6/2023
Oh I see it
BBrody4/6/2023
adam will get you sorted, i know hes done similar setups before
Jjackson4/6/2023
this is such a const _0x2cc0f8 = _0x3ed65d; moment
AAdam4/6/2023
@RageOfFire Can you please explain what the code is supposed to do? I'm working on running it on my own pc, would be helpful to know what the expected behaviour is
Rrageoffire4/6/2023
It for a server that run with a plugin (from game) for my RPGmaker game to allow multiplayer game
AAdam4/6/2023
Ah great, thank you Sounds like you want to add cd commands before your build command, then cd commands to get out of that folder to run your start command
Rrageoffire4/6/2023
yes that want I need
AAdam4/6/2023
you can chain commands together by separating them with a semicolon like so:
cd foldername; npm install
cd foldername; npm install
Rrageoffire4/6/2023
Dockerfile:15
-------------------

13 | # build phase
14 | COPY . /app/.
15 | >>> RUN cd Core/Server; npm install
16 |
17 |
-------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c cd Core/Server; npm install" did not complete successfully: exit code: 127

Error: Docker build failed
Dockerfile:15
-------------------

13 | # build phase
14 | COPY . /app/.
15 | >>> RUN cd Core/Server; npm install
16 |
17 |
-------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c cd Core/Server; npm install" did not complete successfully: exit code: 127

Error: Docker build failed
so here what I get when redeploy
Rrageoffire4/6/2023
BBrody4/6/2023
okay start by giving me a list of commands youd run to build this app locally starting from the root of the project folder
Rrageoffire4/6/2023
first of all I gonna to npm install it in Core/Server but I using window right now so normal I just gonna to head into that folder and open to command promt
Rrageoffire4/6/2023
Rrageoffire4/6/2023
and then go to root folder run index.js file
Rrageoffire4/6/2023
BBrody4/6/2023
okay i will think ill get back to you in a little while you have tried deploying right? can you show me that little table in the top of the build logs?
Rrageoffire4/6/2023
https://pastebin.com/GnBE9ji3 here is full build log
Pastebin
Sticky cache enabled==============Using Nixpacks==============conte...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
BBrody4/6/2023
@RageOfFire done
BBrody4/6/2023
add this file to the root of your project in settings.json you have port defined as 1906, so in the service variables set PORT = 1906 im pretty sure that file will override any build or start commands in the service settings, but just to be safe, clear them before you make a new deployment
Rrageoffire4/6/2023
Thank you very much this working now ! My only problem left is I still can't connect to server seem port error now. I just generation a domain https://domain.up.railway.app/ do it need time to exist to internet ?
BBrody4/6/2023
it would typically be accessible within a few seconds of creation make sure you are using https as a scheme and are not trying to connect to the railway domain with any other port than 443 (aka no port since it's implied with https as the scheme)
Rrageoffire4/6/2023
oh lol 443 overwrite my port XD so now port 1906 kind of useless now everything go to 443 thank you very much everything work perfectly fine now
BBrody4/6/2023
well you can only access your app over 443, you can't open other ports so railway forwards all traffic between the internal port 1906 and 443 but awesome, glad I could help, this was my first time writing up a railway.json config file!
Rrageoffire4/6/2023
wow success in first time you are gold
BBrody4/6/2023
lol thanks, have fun with your game dev stuff!

Looking for more? Join the community!

Want results from more Discord servers?
Add your server
Recommended Posts
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'Facing the following error: FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'mysqldump?Is there a way to use railway cli to execute a mysql dump? I tried railway run with the appropriateLimit on post requests at one timeIs there a limit on post requests at one time? I try to upload more then 1 image at a time on CloudiEmpty vercel env varRailway's pushing an empty env var, `DATABASE_URL`, to vercel. The variable is set up in railway as CLI: railway logs shows logs from old deploymentI've linked the railway CLI to my project. When I execute `railway logs`, I get logs from an old deStrapi app deployHello guys, i did a website for someone with React and Strapi+GraphQL. Now i have to make it live buDeployment removal failsCall to `https://backboard.railway.app/graphql/internal?q=deploymentRemove` fails, it never returns Container Start Failure! "docker": executable file not found in $PATH: unknownTried to add Docker? but got error Here full log: ```fix Sticky cache enabled ======================Prod + Dev (PR) EnvironmentsHi there, I would like to understand how to achieve the following workflow. Production Env: OnlyIs SQL supposed to use this much memory?Hey I am using a mysql db and the memory usage is 500mb? I barely have this in my db.. Is it supposeLimit resources in developer planI created 2 services (postgres and api) when I was testing in the Trial Plan. Now I upgraded my accHow do I delete JUST the service, not my database?rust build faillingseems cant connect to crate.io and rust.lang.orgHelp running flask appThis is my first time using flask so bear with me... here is my app.py code ``` import mysql.connecrailway run 🚨 Not authorized! but can't login``` ❯ yarn dx yarn run v1.22.19 $ railway run --service=app --environment=dev-$(whoami) run-p dx:* -Get an error when uploading a large file through my app: rror: abortedat connResetException```Error: aborted at connResetException (node:internal/errors:711:14) at abortIncoming (node:_http_sHow to connect to another instance without link a public domainI Want to connect with the app "browserless" but I don't want to expose this app for internet. I onlhttpOnly cookies not being set in production using koaHi, I'm trying to set httponly cookies in my koajs app but to no avail I have a custom domain in raSetting up MinIO serviceI set up a docker-orchestrated MinIO service locally. Given there is no service template available fMultiple services on a single domainHi! I have 3 services: API (Backend), Landing that uses this API (Frontend) and a Documentation for