Giter Club home page Giter Club logo

Comments (13)

Potomac54 avatar Potomac54 commented on September 8, 2024 1

@marcbria

Try to run the image with docker-compose.yml and the appropriate environment variables, I run OJS image by typing this in a console :

docker-compose up

it will work if all environment variables are correctly set (.env file, and in the Dockerfile), check also the path for the volumes in docker-compose.yml : for the database, for the config.inc.php file, for the "files" and "public" directories, these 2 directories should have read-write wrights for all users, otherwise the installation (curl command in ojs-cli-install) will fail,

I don't know if the docker-compose.yml provided by the project is correct for the indentations, last time I checked there were indentations errors (in the master branch)

from ojs.

lucasdiedrich avatar lucasdiedrich commented on September 8, 2024 1

@marcbria , actually i thought that you were missing something... hahahha. The main perception of using container is delegation of responsibility, a container should only run a process about its own escope, in OJS container it his own code, i don't know if i'm crystal clear about this, but any doubts just ask.

The database should always run in a separate env, or container. That why Docker enables one thing called Service. In this (docker-compose file) we can declare every container and process needed to ran and intire service. So when docker start in cluster mode it can manage and replicate things correctly, but we can enter matter on other time.

And yes, you're now on the right path. @marcbria , please feel free to add me over gmail, than we can talk better about this.

@Potomac54 before we release the final version we're going to fix the identation of codes, and move it to another folder called examples.

Thanks guys.

from ojs.

lucasdiedrich avatar lucasdiedrich commented on September 8, 2024

Hey @marcbria , you can check the php7 mysql lib here. Have you confirmed that the container tried to contact the database? As i was fixing the 3.1.1.4 version i didn't had time to check this out yet, going to look further tomorrow.

Thanks

from ojs.

lucasdiedrich avatar lucasdiedrich commented on September 8, 2024

@marcbria , i was able to reproduce the error, the problem is that i saw somewhere over pkp forum that the recommend driver is the mysqli now, and i forgot to change over ojs-cli-install. After changing there i get blank pages now and new error.

bash ==> /var/log/apache2/error.log <== [Thu Mar 28 17:31:31.713931 2019] [php7:error] [pid 26] [client 172.19.0.1:49354] PHP Fatal error: Uncaught Error: Call to undefined function session_set_save_handler() in /var/www/html/lib/pkp/classes/session/SessionManager.inc.php:47\nStack trace:\n#0 /var/www/html/lib/pkp/classes/session/SessionManager.inc.php(129): SessionManager->__construct(Object(SessionDAO), Object(Request))\n#1 /var/www/html/lib/pkp/classes/security/Validation.inc.php(371): SessionManager::getManager()\n#2 /var/www/html/lib/pkp/classes/core/PKPPageRouter.inc.php(66): Validation::isLoggedIn()\n#3 /var/www/html/lib/pkp/classes/core/Dispatcher.inc.php(117): PKPPageRouter->isCacheable(Object(Request))\n#4 /var/www/html/lib/pkp/classes/core/PKPApplication.inc.php(252): Dispatcher->dispatch(Object(Request))\n#5 /var/www/html/index.php(68): PKPApplication->execute()\n#6 {main}\n thrown in /var/www/html/lib/pkp/classes/session/SessionManager.inc.php on line 47

from ojs.

lucasdiedrich avatar lucasdiedrich commented on September 8, 2024

@marcbria i found out that we were missing an php7 lib, we need to look if we are missing more libs. Can you please check the new version out?

Thanks.

from ojs.

marcbria avatar marcbria commented on September 8, 2024

Thanks a lot @lucasdiedrich

I need to leave now.
If you don't mind, I will test this on Monday (or during the weekend if I find time).

BTW, do you want me to test the "single" dockerfile as this:
$ docker run --name ojs -p 8087:80 -p 8448:443 -v /etc/localtime:/etc/localtime -d lucasdiedrich/ojs:php7-test

Or the docker-compose (or both).

Cheers,
m.

from ojs.

lucasdiedrich avatar lucasdiedrich commented on September 8, 2024

Both would be great, i've teste with the docker-compose file because of the database settings, and it seems to work very whell now.

Actually what i need first is to test the #14, so i can replace the actual container image that is in production over dockerhub.

Thanks.

from ojs.

Potomac54 avatar Potomac54 commented on September 8, 2024

I tested the Dockerfile from the php7-test git branch, and I notice a problem : mysqli extension is not built and enabled,

the fix is easy : just add at the end of Dockerfile these commands, before the launch of supervisord :

RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli

CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]

from ojs.

marcbria avatar marcbria commented on September 8, 2024

Yep. I confirm @Potomac54 feedback.

Although "mysqli" is shown in the dropdown installation list, the installation fails.
When the module is enabled, it works like a charm.

Now I remember I found the same problem with my local OMP dockerfiles.
Probably with php 7.3 we will get trouble with some other modules (gd...).
¿What about going with php7.2 till 7.3 is consolidated?

Sorry, today I got a crazy day. I will test it deeper and go with docker-compose tomorrow tomorrow.

Thanks for your work,
m.

from ojs.

lucasdiedrich avatar lucasdiedrich commented on September 8, 2024

Actually i can fallback the php version without a problem, and than i will join @Potomac54 recommendations.

Thanks,

from ojs.

lucasdiedrich avatar lucasdiedrich commented on September 8, 2024

One new version is available over dockerhub, please feel free to test @Potomac54 @marcbria

from ojs.

marcbria avatar marcbria commented on September 8, 2024

I'm still getting installation errors on a single-clean docker run, but I arrive to the conclusion that it's me.

Let me 5 minutes to show my testing workflow, to let you show me what I'm doing wrong.

To upgrade the image and containers I did this:

$ docker stop ojs-php7
$ docker rm ojs-php7
$ docker rmi lucasdiedrich/ojs:php7-test
$ docker run --name ojs-php7 -p 8093:80  -v /etc/localtime:/etc/localtime -d lucasdiedrich/ojs:php7-test

After this, would is wonderful, and when I visit the site at http://web.foo.org:8093 I can see the installation wizard, BUT...

When I will the installation fields as follows (jumping the obvious):

  • Directory for uploads: /var/www/html/files <--- This is wrong in the dockerfile. It need to be in just "/var/www/files" (no html) or uploads will be exposed to visitors. When we finish with this problems I will post you an issue with this)).
  • Database driver: MySQLi
  • Host: localhost <--- Look at this !!
  • Username: ojs
  • Password: ojs
  • Database: ojs
  • Create dabase: checked.
  • OAI Settings: empty
  • Beacon: unckeck.

and then I submit the form, OJS reports:

"Errors occurred during installation A database error has occurred: No such file or directory"

Then I log into the container and PHP's log don't add more light (IPs and urls anonymized):

[Wed Apr 03 16:48:55.443032 2019] [php7:warn] [pid 46] [client 158.109.x.x:41896] PHP Warning: Declaration of InstallHandler::validate($request) should be compatible with PKPHandler::validate($requiredContexts = NULL, $request = NULL) in /var/www/html/lib/pkp/pages/install/InstallHandler.inc.php on line 118, referer:http://web.foo.org:8093/index/install/install
[Wed Apr 03 16:48:55.517637 2019] [php7:notice] [pid 46] [client 158.109.x.x:41896] No such file or directory, referer: http://web.foo.org:8093/index/install/install
[Wed Apr 03 16:48:56.519112 2019] [php7:warn] [pid 32] [client 158.109.x.x:41900] PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/html/cache/t_compile/e8ea13aa559bf8604ca823015b397a28d8666486^28682bb3d6b6e750ebd3d458abc8f92b4da9ea9f_0.app.headerusernav.tpl.php on line 136, referer: http://web.foo.org:8093/index/install/install

The errors are just warnings and notice level and the only clue is a "No such file or directory" without telling what directory. Log also talks about "cache" folder (where I found some files with root permission) so I chown and chmod to be very permissive with apache user... but didn't help.

Then I installed mysql-client to log into the mysql... but no mysql answers on localhost.

So I checked if mysql was installed as follows:
$ apk add openrc --no-cache
$ rc-service --list

An there is no mysql at all. And here I started discovering how much stupid am I...
Yesterday I tested the "latest" branch and I got similar issues (not published because I didn't got a solution).

So... her I arrive to the conclusion that I completely misunderstand the docker model and I was testing it incorrectly. Sorry for this. As I said, I'm new to docker.

I mean, I was expecting to have a running/operative docker even when we rise it alone, is this right?
If yes, we need to add database layer (mysql) in the dockerfile, don't we?

But from your dockerfile I understand docker model is keep it very simple (only rise OJS) and delegate the complexity to docker-compose.yml.

A simple dockerfile is good for those scenarios where they rise ojs and have a single mysql server, and also useful as a basis for those who like to build a full stack.

I need to leave now. I will try to test the docker-compose version between this week, that probably will work like a charm. :-)

Please @lucasdiedrich confirm that I'm now in the right way, and sorry for the misunderstanding (and the long mail). :-)

Cheers,
m.

from ojs.

marcbria avatar marcbria commented on September 8, 2024

The database should always run in a separate env, or container. That why Docker enables one thing called Service. In this (docker-compose file) we can declare every container and process needed to ran and intire service. So when docker start in cluster mode it can manage and replicate things correctly, but we can enter matter on other time.

Thanks for the explanation. All clear now.

About the final structure, I like the idea of an examples folder with different docker-compose.yml but we can keep a "default" one close to the Dockerfile.

Too much conversations mixed in this post. I will close it and, if is ok for you, open an issue to only talk about the final structure.

from ojs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.