How to deploy angular 14 app

vdnuwizoTRIAL

a year ago

I have project which runs

on only

npm install -f
and ng serve

so how to deploy this in railway

15 Replies

a year ago

please share your repo so I can advise further


vdnuwizoTRIAL

a year ago

please share your repo so I can advise further

I would but its a private repo, I don't own it, just managing it


a year ago

can you provide a sample angular 14 app?


vdnuwizoTRIAL

a year ago

you mean like this ?
https://github.com/bezkoder/angular-14-crud-example

also this is the build error log

[Region: us-west1]

==============

Using Nixpacks

==============

context: aaf9e736c10a3fb00e42821ac0752574

╔════════ Nixpacks v1.20.0 ═══════╗

║ setup │ nodejs18, npm-9x ║

║─────────────────────────────────║

║ install │ npm ci ║

║─────────────────────────────────║

║ build │ npm install -f ║

║─────────────────────────────────║

║ start │ npm build ║

╚═════════════════════════════════╝

0 building with "default" instance using docker driver

1 [internal] load .dockerignore

1 transferring context: 2B done

1 DONE 0.0s

2 [internal] load build definition from Dockerfile

2 transferring dockerfile: 2.08kB done

2 DONE 0.0s

3 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1702339400

3 DONE 0.2s

4 [stage-0 1/10] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1702339400@sha256:1a9c1eed040aacf8f898be048210ef2d3366b1228373c4e6818362bb75611b32

4 DONE 0.0s

5 [internal] load build context

5 transferring context: 27.71MB 0.3s done

5 DONE 0.3s

6 [stage-0 2/10] WORKDIR /app/

6 CACHED

7 [stage-0 3/10] COPY .nixpacks/nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix .nixpacks/nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix

7 CACHED

8 [stage-0 4/10] RUN nix-env -if .nixpacks/nixpkgs-bf744fe90419885eefced41b3e5ae442d732712d.nix && nix-collect-garbage -d

8 CACHED

9 [stage-0 5/10] COPY . /app/.

9 DONE 0.7s

10 [stage-0 6/10] RUN --mount=type=cache,id=s/a4b4f05f-e328-499b-b55f-514abe4f32a5-/root/npm,target=/root/.npm npm ci


a year ago

that should be a perfect example repo.

there are no errors in those logs, use this instead https://bookmarklets.up.railway.app/log-downloader/


vdnuwizoTRIAL

a year ago

okay here is text downloaded
https://justpaste.it/errorrail

so how to deploy this


a year ago

that link doesn't work.

I'm working on that, railway is not designed for frontend hosting so I'm working on integrating a web server like caddy into the project you sent me.


vdnuwizoTRIAL

a year ago

oh okay, I thought railway supported both front and backend
here log https://qtext.io/0m5x


a year ago

support, yes

automagically like vercel, no


vdnuwizoTRIAL

a year ago

okay
here log https://qtext.io/0m5x
I tried in Versal today, the deployment was taking a lot of time, like more than 1 hr and it failed, so was looking for an alternative, am trying there again now


a year ago

you have dependency conflicts, that isn't something we can help with here, unfortunately.

I will however get the repo you linked running on railway.


vdnuwizoTRIAL

a year ago

okay, thank you so much for instant help,
right now I think its running in versal, some how launched it


a year ago

here is the repo you linked running on railway - https://test-service2.up.railway.app/

none of the crud stuff is going to work since I'm not running the backend for it, but it serves as proof it is possible.

here is the commit I made to the repo with the changes/additions that where needed to run the app on railway - https://github.com/brody192/angular-14-crud-example/commit/f0f17cb0c50b7ec493ba4af62c913d313e3821bf


vdnuwizoTRIAL

a year ago

damn, thanks, ill try to run some other projects here


a year ago

happy to help!