How to deploy Angular on Railway?
How can I deploy my Angular 14 app on railway. Do I need to do anything? Like create a dockerfile (if yes, any template I can use)?
Project ID: 988851b6-78d5-44de-a73d-3e5b6468c8bf
43 Replies
Project ID:
988851b6-78d5-44de-a73d-3e5b6468c8bf
https://github.com/brody192/angular-template
- copy the nixpacks.toml and Caddyfile from that repo into yours
- make sure your
outputPath
is set to dist
in your angular.jsonOk, will try, keep the dockerfile?
Correct?
"outputPath": "dist/theapp-app",
I added nixpacks.toml and Caddyfile (and kept dockerfile) and the deploy went without errors but I get 503 when trying to access the url to the app
Deploy fails if I remove the dockerfile
I didn't know you had a dockerfile, delete the dockerfile
as previously mentioned, your
outputPath
should be dist
Ok changing to this and now redeploying
"outputPath": "dist",
Nope deploy failed anyway
build logs please https://bookmarklets.up.railway.app/log-downloader/
you have dependency conflicts, please fix that
ok will try
Works fine on Vercel but will try to fix
vercel is probably ignoring them
True
I do like this on Vercel? Can I do the same here on Railway?
npm install --legacy-peer-deps
you can but you really should fix the deps issues
if you really don't want to, then yes I'll modify your nixpacks.toml file to run that install command instead
Absolutely, but I am just trying it out to see if I can run my entire stack on Railway
Tried this in the settings but it did not work
How can I add it to the nixpacks?
that's where the build command goes
you don't want to fix the deps issues?
I will fix them, but I am just checking all works on Railway first. Then I can go deeper
okay then when I'm back at my computer I will send you a new nixpacks.toml file, in the mean time make sure you clear any build or start commands you may have set yourself anywhere
Yes, no rush! Its 2.30 am here in Sweden so I am going to bed anyway.
BTW, fantastic releases this week. Super well done!
haha i dont work for railway, i didnt release anything
Ah ok haha, I thought this was the Railway support, sorry for bombarding you with these requests Brody!
thats what im here for though
Ah ok
Since you are always here and always awake I guess your are AI or really dedicated 🙂
Will try the nixfile, thx!
both
haha
well how did it go?
Well it worked at the end but the overall connection to Rails is so slow so it will not work for this project. Also this project are using white label custom domains for each user and the Railway way of handling domains are a bit of a hassle. It uses some type of cnames that not even Dnsimple.com supports.
pretty sure dnsimple does support cnames, at the root level
@macwilko sorry for the ping, but you use dnsimple with railway without issues right, and do you have cnames at the root level?
hey! I do use DNSimple, without issues! Let me check the setup
it won't verify the domain, at least on railway
but it does work
I use ALIAS
how often does that alias update again?
i mean its been like that for months... I don't think it ever updates lol
and I'de totally be using Cloudflare if they weren't blocking my traffic to the apps lol
even after turning everything off, it was still throwing challenges to users, and the app isn't a web app
even with the proxy off?
i'm gonna setup the mTLS thingy down the road, but it's a challenge for another time
no i never turned it off... but its kind of one of these things i need to test alot, otherwise traffic to the site is blocked and nobody can use the app lol
i'm reluctant to play around with it too much
use fastly
yeah gonna look into both Cloudflare / Fastly
kinda expecting around February for stuff like this to be necisary
gonna try this!
interesting
@macwilko those screenshots look rlly nice, what are you using to take them?
Xnapper