Code Monkey home page Code Monkey logo

Comments (3)

GrahamDumpleton avatar GrahamDumpleton commented on June 23, 2024

Your suggestion unfortunately will not work in general case as the requirements.txt file may need to reference a local package that was copied in as part of your source code. So it gets complicated.

That mod_wsgi gets reinstalled is an issue I know of. It is actually installed as part of system wide Python as well and virtual environment chains off that and it is found, but when run out of system Python mod_wsgi wasn't picking up virtual environment correctly. I need to revisit it to work out how to fix that and then I can drop second installation of mod_wsgi. It only came up that that broke things in last week and I had to revert to doing the second installation.

Anyway, I haven't got a lot of time to explain in detail right now, or check my recipe works, as at training day, but presuming running Docker locally and how your Docker system is setup allows local file system mounting, the images are specifically set up to allow you to do.

docker build myapp .
docker run -v `pwd`:/app -p 8000:80 myapp --reload-on-changes

So you build it once to get an image with required dependencies, but then you actually mount the current directory into the container, overlaying and hiding what was copied in. You then ensure that --reload-on-changes option is also supplied to mod_wsgi-express and you can then make changes to the local file system to code files and your application will auto reload changes. This will allow you to do development.

See if you can get that going and if not tell me what OS you are using and how Docker was installed.

from mod_wsgi-docker.

collinjackson93 avatar collinjackson93 commented on June 23, 2024

I kind of figured it wouldn't be that simple, but I figured I would suggest it on the off chance that it would work.

Thanks for the work around; I'll give it a shot.

from mod_wsgi-docker.

GrahamDumpleton avatar GrahamDumpleton commented on June 23, 2024

The additional reinstall of pip and mod_wsgi shouldn't occur now. This is because the Python virtual environment has been done away with as it causes various problems. If you have stuff in 'requirements.txt', they will still be installed though.

The changes made are quite significant, but everything should still run okay. If you see any problems, especially with access permissions at run time, let me know ASAP.

from mod_wsgi-docker.

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.