Coder Social home page Coder Social logo

Comments (4)

leckylao avatar leckylao commented on August 10, 2024

One issue is without volume the code doesn’t automatic update. But seems the design of volume doesn’t allow modifying the files from inside the docker, so a trade-off.

from docker-lumen.

saada avatar saada commented on August 10, 2024

Hey @leckylao

Thanks for reporting that issue.
This is a known docker-ism. One thing we could do is set the container uid to match the host machine's from inside the docker-compose.yml file.

service1:
  user: "$UID:$GID"
  ...

Can you please test that and make a PR accordingly?
Thanks!

from docker-lumen.

leckylao avatar leckylao commented on August 10, 2024

Hi @saada, that user variable works. So what I did is checking the files belong to which user

docker-compose exec php ls -la /var/www/html
total 112
drwxr-xr-x 1 1000 staff 442 Jun 30 12:06 .
drwxr-xr-x 4 root root 4096 Jun 30 12:06 ..
-rw-r--r-- 1 1000 staff 12288 Jun 30 12:06 .Dockerfile.swp
-rw-r--r-- 1 1000 staff 310 Jun 30 12:06 Dockerfile

and adding

user: “1000”

this way you will see the process runs with the same user

docker-compose exec php ps -aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
1000         1  1.7  0.8 123512 17136 ?        Ss   12:09   0:00 php-fpm: master
1000         5  0.0  0.3 123512  7944 ?        S    12:09   0:00 php-fpm: pool w
1000         6  0.0  0.3 123512  7944 ?        S    12:09   0:00 php-fpm: pool w
1000         7  0.0  0.0  17500  2012 ?        Rs+  12:09   0:00 ps -aux

The other way is using environment variable

export UID
and set
user: “${UID}”

from docker-lumen.

saada avatar saada commented on August 10, 2024

awesome!
I'll go ahead and close this issue. You could still submit a PR if you like.
Thank you

from docker-lumen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.