简体   繁体   中英

Docker vs node.js

I'm fairly new to React-native. Im sorry about quite a convoluted question but I have dilemma. I am building an API that communicates with a server app that Im working on, I have been using Docker successfully to run containers BUT I'm constantly being told that I don't need to run Docker at all. I understand the principles of Docker and Node.JS but in all honesty I cant imagine how I would run server side without Docker. Ive tried Node.js and seemed to require a PHP server, which I was also told I did not need. Is this true? which is better Docker or Node.JS? and If Node JS is better how to run it without a php server as it is my understanding that php serves the pages and React consumes the pages.

'You can just install Node, frequently through your OS's package manager. It doesn't require PHP or other language interpreters. I find working directly with Node much easier than using Node in Docker: it is actually a local development environment that my IDE is comfortable with, and not a path to run a Node interpreter "somewhere else" that's isolated from my desktop tooling. '

1)After a few weeks of research I found that I didn't need docker at all. Within Node is the ability to run a server using either fastify or express. I just needed to check on the relevant documentation for usage

2) I linked fastify to ngrok and exposed my local IP address to a public facing direction 3) I linked the ngrock url to my freedns and voila. it worked. 4) I had a small problem with the port which was resolved by using the command ngrok http 127.0:0.1:5000

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM