skip to Main Content

Minimal Example

Setting up a new Angular 17 project (Node 18) as follows:

$ npm install -g @angular/cli@17
$ ng update @angular/core@17 @angular/cli@17
$ npm update

$ ng new example
stylesheets? $ SCSS
SSR? $ yes
$ cd example
$ ng serve

Connects just fine on localhost:4200.

Deploying it with Docker does not work, because all the example Dockerfiles expect older Angular versions without SSR.

Seriously, guys. Before giving an answer try actually creating an Angular 17 SSR project and try if it works with your Dockerfile.

Docker Failures

I tried following these suggestions (remember to replace as necessary e.g.the node version node:12-slim by node:18-slim, the project name sample-angular-app by the project name example, doing the ports correctly etc.):

2

Answers


  1. Your app is written in TypeScript, but your Dockerfile is made for JavaScript apps. Have a look at TypeScript documentation on how to compile TypeScript to JavaScript. If you want a tutorial to follow, check out this one.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search