i have a sample project using reactjs and nodejs below is the folder structure.
movielisting
Dockerfile
client
package.json
package.lock.json
... other create-react-app folders like src..
server
index.js
I start this project by npm run start - client folder and nodemon index.js - server folder. All my api's are written in server folder. My client is running in port 3000 and server is running in port 4000, i have added proxy in package.json of client like below
"proxy": "http://localhost:4000"
So what i am trying to achieve in Dockerfile is i want to start application by running this Dockerfile
1) i need to create the build of client by running npm run build
2) copy to the workdir inside the container
3) copy all server folder
4) npm install for the server folder
5) proxy the application
how can i do this one ? should i need to write some code in nodejs to serve the build index.html file
also how can i run the Dockerfile command to run the application.
Any help appreciated !!!