So far I have build the image and deployed it to AWS EC2. But I want to use
serve -s build
to serve the app in production mode. I did it locally and apparently everything seems to be fine..I get this..
┌──────────────────────────────────────────────────┐ │ │ │ Serving! │ │ │ │ - Local: http://localhost:5000 │ │ - On Your Network: http://192.168.1.91:5000 │ │ │ │ Copied local address to clipboard! │ │ │ └──────────────────────────────────────────────────┘
And the page enters..but the when I try to make a request to the api I get 404.
I wanted to know how does react build works and what do I need to do to put it in production mode. And also, what is the dist folder for?
This is my Dockerfile:
FROM node
#Create app directory
WORKDIR /app
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
#Install dependencies
RUN npm install
RUN npm install [email protected] -g --silent
#Copy app's source code inside the Docker image
COPY . .
#Expose the app's port
EXPOSE 3000
#Run the app when the container is ran
CMD ["npm", "start""]
Thanks!