We are going to develop a react pwa with dockersetup and to publish the app on gitlab pages during deployment to master branch.
I work on a windows device and cant get the feature of hotreloading in dev-mode. Whenever i make some change, the code isnt recompiling. I have to docker-compose up --build
every single time for every change.
Is there any possible way to get hotreloading working on a windows/docker/create-react-ap
p setup?
Following the package.json:
{
"name": "Appname",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-scripts": "2.1.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"buildandserver": "react-scripts build && serve -s build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
Now the Dockerfile for Dev-Setup:
FROM node:9.6.1
# set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
# add `/usr/src/app/node_modules/.bin` to $PATH
ENV PATH /usr/src/app/node_modules/.bin:$PATH
# install and cache app dependencies
COPY package.json /usr/src/app/package.json
RUN npm install
RUN npm install react-scripts@1.1.1 -g
# start app
CMD ["npm", "start"]
And at least the docker-compose for dev-setup:
version: '3.5'
services:
App-Name:
container_name: App-Name
build:
context: .
dockerfile: devsetup/Dockerfile
volumes:
- './:/usr/src/app'
- '/usr/src/app/node_modules'
ports:
- '3000:3000'
environment:
- NODE_ENV=development
Im running docker for windows on the device. I hope anyone can help me out of here...Thanks!