I am trying to create a production build for online deployment of create-react-app with an express js backend using docker.
This is my docker file:
FROM node:12.18.3
WORKDIR /app
COPY ["package.json", "package-lock.json", "./"]
RUN npm install --production
COPY . .
RUN npm run build
EXPOSE 80
CMD ["npm", "start"]
I am using npm run build but still the react developer tools tells that it is a development build and not a production build.
Also in the sources all the project files are visible which should not be visible:
I have tried adding the below statement in the .env file in the root directory of the create-react-app but the project files are still visible:
GENERATE_SOURCEMAP=false
It will be helpful if anyone can guide me how do I fix this and create a production build.
Thank you
