Skip to content

Commit

Permalink
feat: use polling in docker development to enable hot reload
Browse files Browse the repository at this point in the history
documentation:
https://vite.dev/config/server-options#server-watch
-> https://github.com/paulmillr/chokidar/tree/3.6.0#performance
->
```
usePolling (default: false). Whether to use fs.watchFile (backed by
polling), or fs.watch. If polling leads to high CPU utilization,
consider setting this to false. It is typically necessary to set this to
true to successfully watch files over a network, and it may be necessary
to successfully watch files in other non-standard situations. Setting to
true explicitly on MacOS overrides the useFsEvents default. You may also
set the CHOKIDAR_USEPOLLING env variable to true (1) or false (0) in
order to override this option.
```

refs KK-1367
  • Loading branch information
karisal-anders committed Jan 2, 2025
1 parent ed16447 commit 2260422
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ FROM appbase AS development
ARG NODE_ENV=development
ENV NODE_ENV $NODE_ENV

# Enable hot reload by default by polling for file changes.
#
# NOTE: Can be disabled by setting CHOKIDAR_USEPOLLING=false in file `.env`
# if hot reload works on your system without polling to save CPU time.
ARG CHOKIDAR_USEPOLLING=true
ENV CHOKIDAR_USEPOLLING=${CHOKIDAR_USEPOLLING}

# copy in our source code last, as it changes the most
COPY --chown=default:root . .

Expand Down

0 comments on commit 2260422

Please sign in to comment.