In order to streamline the development for our OJS and OMP applications and to ease the deployment of ready-to-go code from our test environment onto our productive environment, we have decided to use Docker.
What follows is an outline of the steps necessary to run an OJS installation in a Docker container:
OJS install pipeline
install git, gitlab-runner, docker on server, configure gitlab runner
configure ./resources/ojs.config.inc.php (host, port pwd, mail, etc.)
configure .env and docker-compose-ojsprod.yml (host, port, pwd, etc.)
First we need to create all directories, referenced as volume form docker-compose-ompdev.yml OJS data are located in /data/ojsprod and /data/ojsdev
/data/ojsdev/config
/data/ojsdev/db
/data/ojsdev/files
/data/ojsdev/logs
/data/ojsdev/plugins
/data/ojsdev/private
/data/ojsdev/public
uid and gid of directories should correspond within the container ids
e.g.: container ojs_app_ulb
$ id apache
uid=100(apache) gid=101(apache) groups=101(apache),82(www-data),101(apache)
container ojs_dbdev_ulb:
$ id mysql
uid=999(mysql) gid=999(mysql) groups=999(mysql)
So set appropriate on host machine:
sudo chown 100:101 /data/ojsdev/ -R sudo chown 999:999 /data/ojsdev/logs/db -R sudo chown 999:999 /data/ojsdev/db -R
From your clone directory start ./build.sh
This will setup all data for you to start the docker container in developent, production or local mode. (There is probably some extra work if you start from scratch.)
To start container use start and stop scripts:
./start-ojs local
./stop-ojs local
Please check .env for further settings!
If you are working with gitlab you can use the .gitlab-ci.yml
to fire up your gitlab-runner.
GPL3
https://typeset.io/resources/the-a-z-of-open-journal-systems-ojs-3-user-guide/