I have created a node application using typescript.
{
"name": "my-app",
"version": "1.0.0",
"main": "index.ts",
"author": "",
"license": "MIT",
"scripts": {
"start": "node -r ts-node/register index.ts",
},
"dependencies": {
"@types/express": "^4.17.3",
},
"devDependencies": {
"ts-node": "^7.0.1",
"typescript": "^3.4.5"
}
}
Currently, I have used following docker file for running my application
FROM node:10
WORKDIR /app
COPY package*.json ./
RUN npm i
COPY . .
EXPOSE 1234
CMD ["npm", "run", "start"]
I want to run my application using node command instead of npm
FROM node:10
WORKDIR /app
COPY package*.json ./
RUN npm i
COPY . .
EXPOSE 1234
CMD ["node", "-r", "ts-node/register", "index.ts"]
But it throws an error like this
'egister", "index.ts"]' is not recognized as an internal or external command,
operable program or batch file