DEV Community

Discussion on: Dockerize a React app with Node.js backend connected to MongoDb

Collapse
 
akarabach profile image
Andrei Karabach

Is live reload works in case when uses port 3000 and I'm changing files locally ?

Collapse
 
workmap profile image
Tyler McCracken

Hi Andrei, for live updates, I changed my 'ui' service in my docker-compose to:
ui:
build: ./ui
ports:

  • '3000:3000' depends_on:
  • api volumes:
  • ./ui/src/:/usr/src/app/src stdin_open: true
Collapse
 
vguleaev profile image
Vladislav Guleaev

I think, it should not work. Because we didnt map our local files with files in docker. We need to make volumes for that.

Collapse
 
stanleysathler profile image
Stanley Sathler

A post explaining a bit more about Docker volumes would be welcome too. :)

Thread Thread
 
workmap profile image
Tyler McCracken

Hi Stanley, for live updates, I changed my 'ui' service in my docker-compose to:
ui:
build: ./ui
ports:
- '3000:3000'
depends_on:
- api
volumes:
- ./ui/src/:/usr/src/app/src
stdin_open: true

Some comments have been hidden by the post's author - find out more