Reputation: 89
I am running angular 7 app with below docker file with node:16.13.2 LTS
FROM node:16.13.2
ENV context ""
RUN mkdir -p /usr/src/
WORKDIR /usr/src/
COPY . /usr/src/
RUN npm install
ENV context ""
EXPOSE 3000
CMD [ "npm", "--", "start", "--serve-path=${context}/"]
I am using this command to run this app :
docker run -p 3008:3000 -e context=/a7 myImageName
now If I access that in browser I get following message.
crbug/1173575, non-JS module files deprecated.
(anonymous) @ VM214:6774
Can anyone please help me on this Issue?
Upvotes: -1
Views: 352
Reputation: 1
I had the same issue. After changing the port from 1624
to 3000
, the issue was resolved
Upvotes: -1
Reputation: 89
I solved it and could resolve this issue. below is my old package.json
"scripts": {
"ng": "ng",
"start": "ng serve --port 3010 --host 0.0.0.0 --disable-host-check true",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test --browsers ChromeHeadless --watch=false",
"lint": "ng lint",
"e2e": "ng e2e",
"sonar": "sonar-scanner",
"test:jest": "jest ./src/app"
},
below is my updated package.json (just updated the port to 3000 and it worked)
"scripts": {
"ng": "ng",
"start": "ng serve --port 3000 --host 0.0.0.0 --disable-host-check true",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test --browsers ChromeHeadless --watch=false",
"lint": "ng lint",
"e2e": "ng e2e",
"sonar": "sonar-scanner",
"test:jest": "jest ./src/app"
},
Looks like port was being used as from package.json not from dockerfile. so it has utilised the port mentioned in package.json.
Upvotes: 2