1

i'm trying to launch a nodejs container using AWS FARGATE, the problem i'm facing is that fargate gives me this error :

cannot find this module "/path/to/file/webrtc.js"

And when i execute npm install from the command section when launching the container it gives me

npm WARN enoent ENOENT: no such file or directory, open '/usr/src/app/package.json'
npm WARN saveError EACCES: permission denied, open '/usr/src/app/package-lock.json.12345678'
npm WARN saveError ENOENT: no such file or directory, open '/usr/src/app/package.json'

How to give permission ? I tried changing the json file and swapping user = null with user = root, but same error appears.

thank you,

1 Answer 1

1

You should build the container in such a way that it works right after starting without executing extra commands.

Maybe a tutorial on Dockerizing node.js apps may come handy for start.

Hope that helps :)

6
  • Hi, Thank you for commenting, ok, so i figured that i don't have to cmd npm commands in the container but there is one last thing that needs to be done, which is this : ``` CMD [ "node", "server.js" ] ``` How to run this in the fargate, it exists in the image but will fargate be able to use it without me explicitly putting it ?
    – logax
    Commented Aug 24, 2020 at 16:47
  • If you do docker run --rm -it yourimage locally on your laptop does it work and does it do what you want? If not then it won’t work in Fargate either. Make sure your docker image is built correctly and verify it locally before running it in Fargate.
    – MLu
    Commented Aug 24, 2020 at 20:59
  • i'm just starting to use docker, so i'm not very familiar with it, we used docker-compose to run the image, and it runs perfectly fine, i don't know why it gives me errors when using it on fargate.
    – logax
    Commented Aug 25, 2020 at 10:05
  • Is it possible to merge what we have in docker-compose to the docker file ?
    – logax
    Commented Aug 25, 2020 at 15:44
  • Possibly. Depends what your docker-compose.yml contains. Post it to your question.
    – MLu
    Commented Aug 25, 2020 at 21:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .