p5.js-web-editor icon indicating copy to clipboard operation
p5.js-web-editor copied to clipboard

File Changes Not Reflecting in Docker Container

Open AbhigyanSrivastav opened this issue 1 year ago • 8 comments

File Changes Not Reflecting in Docker Container

Environment:

  • OS: Windows
  • WSL2: Enabled
  • Docker: Using Docker Desktop with WSL2 integration

Description: I am trying to set up this project locally using Docker with the provided development Docker Compose setup. However, I am facing an issue where changes made to the files on my local machine are not reflecting in the Docker container.

Docker Compose Configuration:

services:
  mongo:
    image: mongo:5.0
    volumes:
      - dbdata:/data/db
  app:
    build:
      context: ./
      dockerfile: Dockerfile
      target: development
    environment:
      - MONGO_URL=mongodb://mongo:27017/p5js-web-editor
    volumes:
      - .:/usr/src/app
      - /usr/src/app/node_modules
    ports:
      - '8000:8000'
      - '8002:8002'
    depends_on:
      - mongo
volumes:
  dbdata:

AbhigyanSrivastav avatar Oct 13 '24 04:10 AbhigyanSrivastav

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already.

welcome[bot] avatar Oct 13 '24 04:10 welcome[bot]

Hey @AbhigyanSrivastav were you able to resolve this issue? Even i am facing the exact same issue need help

adwaitanand avatar Nov 12 '24 05:11 adwaitanand

Hi , i have created a PR that i think should solve this problem , review required

shauryatiwari1 avatar Dec 15 '24 19:12 shauryatiwari1

Hey! , I have checked this issue again and i think there is no problem now , the file syncing works even without ":cached" (though i think it will fix that if its not working without it) . I think that this issue #3246 can be closed now!!

shauryatiwari1 avatar Dec 21 '24 11:12 shauryatiwari1

@AbhigyanSrivastav @raclim File syncing in Docker Compose with WSL2 may experience performance bottlenecks. To enhance file sharing efficiency, We need to use :cached option in the volume configuration. This change needs to be done in the docker-compose.yml file.

Soon i will create a PR which will fix this issue.

Harshit-7373 avatar Feb 08 '25 12:02 Harshit-7373

Thanks for raising this issue!

I want to note that I think adding the flag might not be the full resolution to this issue, as it seems that adding the :cached flag is no longer needed as it's already set as a default in Docker Desktop 2.4.0.

raclim avatar Feb 11 '25 19:02 raclim

@AbhigyanSrivastav maybe you Have to Go through Docker Documentation for windows they requires docker sync and other dependenct for windows synchoronization updates
https://docker-sync.readthedocs.io/en/latest/getting-started/installation.html#installation-windows

Docker on Windows (especially with Windows Subsystem for Linux (WSL) or Docker Desktop) can have specific issues with file synchronization and live reload due to differences in how the file system works compared to Linux.

Jatin24062005 avatar Mar 04 '25 07:03 Jatin24062005

@AbhigyanSrivastav maybe you Have to Go through Docker Documentation for windows they requires docker sync and other dependenct for windows synchoronization updates https://docker-sync.readthedocs.io/en/latest/getting-started/installation.html#installation-windows

Docker on Windows (especially with Windows Subsystem for Linux (WSL) or Docker Desktop) can have specific issues with file synchronization and live reload due to differences in how the file system works compared to Linux.

Thanks for the suggestion! I’ve already gone through the documentation and tried some workarounds, but they didn’t seem to resolve the issue. However, I’ve now successfully cloned the project onto my machine.

AbhigyanSrivastav avatar Mar 04 '25 16:03 AbhigyanSrivastav