docker
ppamorim
TRIALOP

a year ago

I am trying to deploy this project but it keeps giving error when it runs the dockerfile on railway: https://github.com/Corkscrews/taille-auth/actions/runs/12760997822/job/35567334745

I tried everything, it appears that target is not being copied to railway?

Solved

74 Replies

ppamorim
TRIALOP

a year ago

4a776254-6ff4-46c3-b88c-07953cfddb2e


ppamorim
TRIALOP

a year ago

thank you all 🙂


a year ago

COPY ./target/release/taille-auth /taille-auth

Yet target/release/taille-auth does not exist in that repo.

Its a good thing it doesn't though, you want to have the Dockerfile build the binary, not copy it in.


ppamorim
TRIALOP

a year ago

I don't want to use the dockerfile to build the binary, that's why it's done in the github workflow


ppamorim
TRIALOP

a year ago

is the cli copying the source code from the repo instead the . ?



ppamorim
TRIALOP

a year ago

it appear it does


ppamorim
TRIALOP

a year ago

hmmm


ppamorim
TRIALOP

a year ago

@Brody in that link, if you check the step before, I added a ls to check if target exists


ppamorim
TRIALOP

a year ago

Inside the dockerfile running in railway

1328657811235668029


ppamorim
TRIALOP

a year ago

but the file is there under target/release

1328658348626804820


ppamorim
TRIALOP

a year ago

I could upload the binary and download it on the dockerfile but it seems cumbersome


a year ago

why do you not want the Dockerfile to build the binary?


ppamorim
TRIALOP

a year ago

because I dont want to waste cpu time on railway = cost


a year ago

we don't charge for build?


a year ago

and even if we did, i still could not recommend what you are attempting to do


ppamorim
TRIALOP

a year ago

any specific reason? both are on ubuntu-latest


a year ago

its needless added complexity


ppamorim
TRIALOP

a year ago

ok, just find odd that the cli doesn't copy all the files in ., I checked the source code but I couldn't figure out why. I'd expect it to do something like docker build . and then run.


a year ago

the cli does not run docker build


ppamorim
TRIALOP

a year ago

(I mean the integration)


ppamorim
TRIALOP

a year ago

the cli is probably only uploading the files to your server


a year ago

you are also telling the cli not to copy the target folder -


ppamorim
TRIALOP

a year ago

ok, so railway uses the gitignore


ppamorim
TRIALOP

a year ago

because it's correct, I have target on my local machine and I dont want on remote


ppamorim
TRIALOP

a year ago

but it's generated when building the project in the workflow


ppamorim
TRIALOP

a year ago

I am modifying it to use dockerfile as you said


a year ago

then you can forego the workflow all together, simply deploy via github


ppamorim
TRIALOP

a year ago

hmm, everything appears to be up and running but:

{
  "status": "error",
  "code": 502,
  "message": "Application failed to respond",
  "request_id": "Ka9mROjeTSi6yw-aVO1Z_A_499424464"
}


ppamorim
TRIALOP

a year ago

(I tried 0.0.0.0 and it didn't work)


ppamorim
TRIALOP

a year ago

but I will try again


ppamorim
TRIALOP

a year ago

hmm, it's working oddly


a year ago

your target port was likely wrong


ppamorim
TRIALOP

a year ago

it has the address, 127.0.0.1:3000


ppamorim
TRIALOP

a year ago

but now it's always giving 404


a year ago

404 is returned from your app


ppamorim
TRIALOP

a year ago

odd, it's stuck in Starting Container now


ppamorim
TRIALOP

a year ago

I only did changes in the server internally


ppamorim
TRIALOP

a year ago

just did a redeploy (through the railway UI) and listening now


ppamorim
TRIALOP

a year ago

😦 still, sometimes work, sometimes not


a year ago

i would recommend you add more verbose logs to your app so that you can figure out why its sometimes failing to start


ppamorim
TRIALOP

a year ago

@Brody That's odd, running docker build -t taille-auth . and docker run -it -p 3000:3000 taille-auth in the Dockerfile from main branch works just fine and I can use the server in my localhost.


ppamorim
TRIALOP

a year ago

On Railway, the logs keep stuck on Starting Container



ppamorim
TRIALOP

a year ago

I don't think the server is crashing at all


ppamorim
TRIALOP

a year ago

nothing yet, I tried adding a healthcheck, removed tini, added more logs, nothing 😦


ppamorim
TRIALOP

a year ago

it's still working on my localhost


a year ago

your current deployment has exited


ppamorim
TRIALOP

a year ago

yes because the healthcheck killed it


ppamorim
TRIALOP

a year ago

1329411213691715665


ppamorim
TRIALOP

a year ago

I am out of options, thinking in manually deploy my server on AWS instead


a year ago

not sure what to tell you but this isn't an issue with the platform, when you only see starting container, your app has already exited.


ppamorim
TRIALOP

a year ago

you are correct, sorry for being rude with you


a year ago

not being rude at all


ppamorim
TRIALOP

a year ago

@Brody I believe I found the issue, it's because inside the docker I was applying some optimisation to compile the dependencies in a layer up in the list, but it wasn't invalidating the binary. Then the new code was coming, being compiled but it wasn't generating a new binary.


a year ago

that's an interesting find!


ppamorim
TRIALOP

a year ago

I read it's recommended to keep railway to decide the port, how I can setup it in the dockerfile? (in the expose part)


a year ago

railway does not read from the expose keyword in your Dockerfile, your application simply needs to listen on the PORT variable


ppamorim
TRIALOP

a year ago

it appears to be listening

1329533563527364718


ppamorim
TRIALOP

a year ago

my server is listening the port from the env


ppamorim
TRIALOP

a year ago

1329534039727542303


ppamorim
TRIALOP

a year ago

@Brody maybe I found a issue with that on the UI


ppamorim
TRIALOP

a year ago

if you forget to set it to automatic, there is no warning about that

1329534454292676701


ppamorim
TRIALOP

a year ago

shouldn't the port from the env to be 3000?


ppamorim
TRIALOP

a year ago

but it triggered 8080 on my server


ppamorim
TRIALOP

a year ago

it's working now if I set it to automatically set the port, just think a warning about that would make things clear


a year ago

8080 is what Railway sets the variable to


ppamorim
TRIALOP

a year ago

ok, but I had 3000 manually set, shouldn't it use too?


a year ago

no, the target port on the domain does not control the PORT variable


ppamorim
TRIALOP

a year ago

ok


a year ago

so all good now?


ppamorim
TRIALOP

a year ago

all good 🙂


a year ago

!s


Status changed to Solved brody over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...