pkp / docker-ojs

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

ojs cli install doesn't work in docker-compose.yml #52

Open luisfelipe3d opened 3 years ago

luisfelipe3d commented 3 years ago

Expected Behavior

When the environment variable OJS_CLI_INSTALL is changed to 1 on .env file, it is expected that the installation takes place automatically without the need of human interaction.

Current Behavior

After setting up the environment and running docker-compose, I verified that the configuration doesn't work. The following image illustrates the fact: image

Steps to Reproduce

  1. Change directory to /versions/main/alpine/apache/php73/
  2. Set OJS_CLI_INSTALL to 1 on .env file
  3. In the docker-compose.yml file, uncomment lines 16,17 db and 35,36 ojs service
    #     env_file:
    #      - .env
  4. Run docker-composer -f docker-composer.yml up
  5. Access http://localhost:8081

Context (Environment)

More information about the host

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux bookworm/sid
Release:        testing
Codename:       bookworm

$ uname -a
Linux alohomora 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64 GNU/Linux

$ docker -v
Docker version 20.10.5+dfsg1, build 55c4c88

$ docker-compose --version
docker-compose version 1.27.4, build unknown

Cheers, Luis Leal.

frafra commented 2 years ago

I can confirm that. config.inc.php is not populated correctly.

Are you upgrading?

marcbria commented 2 years ago

Sorry for the long silence.

About this specific issue: OJS lacks of a good client and the command-line installation is done via "curl" with some parameters. I really don't trust much in this way of doing and I was never used in real life.

As far as this feature was never tested, this is considered an enhancement. No time right now to work on this so PR are really welcome.

luisfelipe3d commented 2 years ago

I can confirm that. config.inc.php is not populated correctly.

Are you upgrading?

No, I used for development.

matgn commented 2 years ago

Same here. In logs : [OJS CLI Install] First time running this container, preparing... [OJS CLI Install] Calling the install using pre-defined variables... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (7) Failed to connect to localhost port 80 after 0 ms: Connection refused

matgn commented 2 years ago

I tried to force it with docker exec https://github.com/pkp/docker-ojs/blob/main/templates/common/ojs/usr/local/bin/ojs-cli-install

it worked ... Installation of OJS has completed successfully.

marcbria commented 2 years ago

As far as it can be accomplished with the frontend or the workaround posted by @matgn, is not a priority right now, but would be nice to adress this in the new version.

The real problem is the one posted at #179.