Starting my docker container after build
I am not sure exactly what is happening. I am re-using a Dockerfile that I used in render where the last line is
CMD ["scripts/start.sh"]
. Inside that script, is a line to run my migrations and start the server.
However, it doesn't seem to be starting and I don't see the expected logs. I also tried adding this to my toml file, but it didn't seem to make a difference in starting my server.
startCommand = "scripts/start.sh"
Any suggestions?34 Replies
Project ID:
be22cca8-7c9e-4713-8b4f-d7f0bf542219
be22cca8-7c9e-4713-8b4f-d7f0bf542219
Ah I see what's happening. The deploy logs and separate from the build. Will continue to investigate.
what do the deploy logs say?
Running Migrations... 07:18:47.676 [error] Could not create schema migrations table. This error usually happens due to the following: * The database does not existI'm not sure why since I already migrated the db data
have you added a database and setup all the database variable references?
yeah and it looks like it connected to the db correctly
can i see a screenshot of your service variables
Actually maybe i'm not connectd
Solution
please use refence variables
https://docs.railway.app/develop/variables#reference-variables
I copied the values from the postgres service
thats not the correct way
Are you saying it's not ideal or are you saying it won't work properly because the values might be different?
both
okay let me try it now
@Brody So this is the expected right?
yes but you are missing the port database variable
Would that be diff from the default?
yes it would
kk
I think if i saw a line on this page that said "Add this ENVs to your services" that I could click and it would do it for me then i would have realized there is a special way to reference it:
Where do you see that?
Okay so I added my services in this order:
1. web app
2. posgres
3. worker
I see that message in my worker, but not my web app
unless I dismissed it without realizing
you see that here
Oooo i didnt see it the first time. Does it dismiss after I add it?
no clue
Thanks for pointing that out. Really didn't notice it especially since i have an expectation for env screens and just ignored it. I "thought" i knew what i was doing, but clearly i didnt here.
you'll have that on these big jobs
okay great! its deployed!
man this platform is amazing! i love the UI/UX
Definitely dev like UX
happy to hear it
The logging is way better too
man im bullish on this brand
i love it
@Brody thanks again! I have my staging up and running. Will test it out the next few weeks
no problem!