Hi @milanduke
Let me answer by parts:
Has anyone been successful with running OJS in a docker container?
In October alone, OJS images were pulled from dockerHub more than 5,000 times, so I sincerely hope that the answer to this question is “yes” or somewhere there are a lot of people in trouble…
How to deal with plugins?
Just to be sure I understood your exact problem.
You followed this installation process: https://github.com/pkp/docker-ojs
And after this, all works as expected (ojs up and running) but when you install a new plugin… the magic disappears.
When I run OJS locally, I can’t install any plugins at all, plugins are uploaded but not installed and as a result the whole application becomes broken every time I install a plugin.
Well, this is not a problem with docker or OJS images… the problem is that you are running the easyOJS commands without understanding what they entail.
The docker-compose.yml included in the easyOJS example is (intentionally) very basic and meant to run an OJS demo quickly and easily. But if someone wants to do more advanced usage than that (for example install new plugins), they should need to adapt that docker-compose to their needs.
Actually for your case, the adaptation is something simple as (although it does not explicitly mention the plugins) the problem you are facing is the same that is discussed in the documentation, in the “Special Volumes” section.
So, in short… You need to know that, when you install a new plugin, you are doing it inside a container that is “ephemeral” (it will return to its initial state every time you restart the container) but your DB is not ephemeral (because we like to keep it save and it’s stored on the host, outside the container), so when you reset your container, it creates an inconsistency between the code and the DB.
To make your plugins NOT ephemeral, the only thing you have to do is to give the directory “/var/www/html/plugins” persistence. Easiest solution is mapping it to a folder in your host (and make sure the plugins in the host folder are sync with the version of your OJS, of course).
Try this and if you have any problem, report it in this thread and I’ll give you a hand.
I have been more successful running docker containers that comes pre-built with everything. An example is the following web app: https://hub.docker.com/r/alextselegidis/easyappointments
Thanks for the reference. It’s a nice project, but don’t have the complexity we have in OJS so we can’t apply the same solutions.
Anyway, I will take a deeper look to see if we can do things better with our docker images.
Happy new year!