tematres / TemaTres-Vocabulary-Server

Web application for management formal representations of knowledge, like controlled vocabularies, taxonomies, thesauri and glossaries
https://vocabularyserver.com
118 stars 52 forks source link

Can't run with docker #93

Open AbrilJara opened 2 months ago

AbrilJara commented 2 months ago

Hi, im trying to run the app using a apache and mysql but it thows a 500 error and can't find in the logs where is the error.

This is my docker compose file:

version: '3'
services:
  mysql:
    image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: tematres
      MYSQL_USER: tematres
      MYSQL_PASSWORD: tematres
    volumes:
      - mysql-data:/var/lib/mysql
    ports:
      - "3306:3306"

  apache:
    image: php:7.4-apache
    depends_on:
      - mysql
    ports:
      - "80:80"
    volumes:
      - ./tematres:/var/www/html/

volumes:
  mysql-data:

And this is my db config in the vocab folder:

...
$DBCFG["DBdriver"] = "";

/** Dirección IP o nombre del servidor - IP Address of the database server */
$DBCFG["Server"]      = "tematres-db-1";

/** Nombre de la base de datos Database name */
$DBCFG["DBName"]     = "tematres";

/** Nombre de usuario - login */
$DBCFG["DBLogin"]    = "tematres";

/** Passwords */
$DBCFG["DBPass"] = "temates";
...

When i go to localhost it redirects me to localhost/vocab/index.php but it throws a 500 error.

image

The logs from docker apache container:

172.22.0.1 - - [27/May/2024:16:00:55 +0000] "GET /vocab/index.php HTTP/1.1" 500 211 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"

a-roussos commented 2 months ago

Hi @AbrilJara! 👋 I think the HTTP ERROR 500 message is because you're using the wrong DB password. Your Dockerfile claims MYSQL_PASSWORD: tematres but in your vocab/db.tematres.php you have $DBCFG["DBPass"] = "temates";.

AbrilJara commented 2 months ago

Yes, thank you. I got really stuck because I couldn't find the logs of the error until I found how to log them. Also i had to insatall some modules that aren't aviable in the php:7.4-apache.