-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Docker Build Time #7
Comments
Your suggestion unfortunately will not work in general case as the 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.
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 See if you can get that going and if not tell me what OS you are using and how Docker was installed. |
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. |
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. |
I know this image isn't exactly designed for development, but I find it a little cumbersome that the build process installs pip, wheel, mod_wsgi-express, and project dependencies every time there is a code change. Would it be possible to change the
COPY . /app
line toCOPY ./requirements.txt ./app
and then runCOPY . /app
after running mod_wsgi-docker-build? This would only invalidate the cache if the requirements list has changed. (See Dockerfile best practices here for an example)The text was updated successfully, but these errors were encountered: