Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker and ts-node #714

Closed
crivera opened this issue Oct 24, 2018 · 6 comments
Closed

Docker and ts-node #714

crivera opened this issue Oct 24, 2018 · 6 comments
Labels

Comments

@crivera
Copy link

crivera commented Oct 24, 2018

Hi

I have a mini project where the package.json looks like this:

{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "test.js",
  "scripts": {
    "meow": "ts-node -e 'console.log(\"test\")'"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "ts-node": "^7.0.1",
    "typescript": "^3.1.3"
  }
}

When I do npm install and then run npm run meow i see the print out of test.

Now when I do put this now in a docker image with the docker file being:

FROM node:latest

COPY . . 

RUN npm install

ENTRYPOINT ["npm"]

CMD ["run", "meow"]

When i do docker build -t test . and then run docker run -it test the process just seems stuck. Nothing happens.

Have you guys experienced that before? Do I need a special node version?

Thanks
Chris

@crivera
Copy link
Author

crivera commented Oct 24, 2018

When I update the meow command to: node -e 'console.log(\"test\")' and build a new docker image it works fine.

@blakeembrey
Copy link
Member

Do you have a tsconfig.json file?

@crivera
Copy link
Author

crivera commented Oct 25, 2018 via email

@blakeembrey
Copy link
Member

You don’t need one, but probably should have one. I’m taking a guess that it may be related to #690.

@blakeembrey
Copy link
Member

Closing this for now, should be resolved with #690 in 8.0.

@crivera
Copy link
Author

crivera commented Oct 29, 2018

It seems like you need a WORKDIR amd then it will execute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants