pythondockerkubernetesmod-wsgi

mod_wsgi with a read only filesystem - webserver can’t start


I’m using mod_wsgi to create a Python webserver. It has been Dockerized and deployed to kubernetes with readonlyfilesystem=true. The application can’t start because mod_wsgi tries to create files and folders in the tmp folder but it doesn’t have the permission. It’s possible to do it? There is eventually an alternative way to store these files?

Thanks


Solution

  • The concept of readOnlyFileSystem is that the container should be immutable! In some cases, you can create the file in the Dockerfile so the program can read it directly, without needing to create it but, usually, you would have to mount a volume or use Docker's temporary files systems.