Super-Visions / docker-itop

https://hub.docker.com/r/supervisions/itop/
21 stars 19 forks source link

Issue with initial install #1

Closed thatnerdjosh closed 5 years ago

thatnerdjosh commented 5 years ago

I know this isn't likely in any way related to your image but I wanted to check if you have seen this issue and know how to fix it, when I go through the initial install with an empty DB I get this error...

Screenshot from 2019-08-08 21-12-15

Hipska commented 5 years ago

Did you select to install a new iTop, just like the Usage part of the README says?

thatnerdjosh commented 5 years ago

Yes I did

Hipska commented 5 years ago

Strange, as it seems that it cannot connect to the database server.

thatnerdjosh commented 5 years ago

It is able to pull the database name when I select new install, I wonder if for some reason the docker install of mysql doesn't have all necessary permissions by default, what docker commands do you use to run this?

Hipska commented 5 years ago

Indeed, you need to create a DB and a user yourself first. See documentation: https://www.itophub.io/wiki/page?id=2_6_0%3Ainstall%3Astart

thatnerdjosh commented 5 years ago

By default I do create a database and user... even as root it seems I still get the same error so I think it is not permissions. Are you migrating to using this docker container after doing any further setup on the DB side?

Here is my docker-compose.yaml

version: '3.3'
services:
  db:
    image: mysql:5.7
    volumes:
      - db_data:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: itopsroot
      MYSQL_DATABASE: itops 
      MYSQL_USER: itops 
      MYSQL_PASSWORD: itops 
  itop:
    depends_on:
      - db
    ports:
      - "8000:80"
    image: supervisions/itop:latest
    restart: always
volumes:
  db_data: {}
Hipska commented 5 years ago

Okay, I see the problem. Quick fix is to run docker-compose exec itop rm conf/production/config-itop.php Better is to have the following environment vars added to iTop instance:

    environment:
      DB_ENV_MYSQL_DATABASE: itops
      DB_ENV_MYSQL_USER: itops
      DB_ENV_MYSQL_PASSWORD: itops
thatnerdjosh commented 5 years ago

It worked! Closing this issue :) Thanks so much!!!