lucasdiedrich / ojs

Open Journal Systems (OJS) is a journal management and publishing system.
GNU General Public License v3.0
19 stars 64 forks source link

Docker-compose not working out of the box #19

Closed luandro closed 5 years ago

luandro commented 5 years ago

I may be missing something. But I basically cloned this repo, changed .env and ran docker-compose up.

This is the error I get:

ERROR: for pkp_ojs  Cannot start service ojs: OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:424: container init caused \"rootfs_linux.go:58: mounting \\\"/root/ojs/config/ojs.config.inc.php\\\" to rootfs \\\"/var/lib/docker/overlay2/2fb8a4479786e9ceb0bf5304a2154f9967c7f6ea5ae0888f1eadb7e67ff7e4e1/merged\\\" at \\\"/var/lib/docker/overlay2/2fb8a4479786e9ceb0bf5304a2154f9967c7f6ea5ae0888f1eadb7e67ff7e4e1/merged/var/www/html/config.inc.php\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

ERROR: for ojs  Cannot start service ojs: OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:424: container init caused \"rootfs_linux.go:58: mounting \\\"/root/ojs/config/ojs.config.inc.php\\\" to rootfs \\\"/var/lib/docker/overlay2/2fb8a4479786e9ceb0bf5304a2154f9967c7f6ea5ae0888f1eadb7e67ff7e4e1/merged\\\" at \\\"/var/lib/docker/overlay2/2fb8a4479786e9ceb0bf5304a2154f9967c7f6ea5ae0888f1eadb7e67ff7e4e1/merged/var/www/html/config.inc.php\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
ERROR: Encountered errors while bringing up the project.

Any tips on how to get this working? Am I missing something?

Cheers!

Potomac54 commented 5 years ago

Hello @luandro,

check the path of your volumes you have set in the docker-compose.yml file :

volumes:
 - /etc/localtime:/etc/localtime           
 - ./files/private:/var/www/files       
 - ./files/public:/var/www/html/public  
 - ./files/logs:/var/log/apache2   
 - ./config/ojs.config.inc.php:/var/www/html/config.inc.php  
 - ./config/apache.htaccess:/var/www/html/.htaccess        
 - ./config/php.custom.ini:/usr/local/etc/php/conf.d/custom.ini

you must have a file "./config/ojs.config.inc.php" in the directory where docker-compose.yml file is present,

syntax for volumes is

"the path on your hard-disk (could be a directory or a file)":"the path inside the docker image"

lucasdiedrich commented 5 years ago

@Potomac54 and @marcbria

Thinking about @luandro 's problem, i think we should make this volumes path commented by default, we should always have an working docker-compose without changing anything. What you think guys?

Thanks.

Potomac54 commented 5 years ago

yes it's a possibility, provide a docker-compose.yml where all volumes path will be commented, something which can make ojs "plug and play" by running "docker-compose up" command

marcbria commented 5 years ago

Full agree. Docker and docker-compose should work "out of the box".

But it's ok if we add "clues" about how to improve them... for instance, adding commented lines to give persistence to your volumes as we are doing with adminer.

BTW, would be nice to "name" volumes. I will send you a PR as soon as I found time for it. Sorry a lot for the delay. I'm overwhelmed those days with the conference. :-(