juanluisbaptiste / docker-otrs

The unofficial Znuny/OTRS Ticketing System docker image
https://www.juanbaptiste.tech/category/otrs
GNU Lesser General Public License v3.0
173 stars 101 forks source link

issues with otrs-setup.env #3

Closed shadowguardian507-irl closed 7 years ago

shadowguardian507-irl commented 7 years ago

would it be possible to provide an example otrs-setup.env file, to ease use of the docker compose .yml files ?

juanluisbaptiste commented 7 years ago

Just put any of the env variables mentioned on the documentation there instead of the environment: section of the docker-compose.yml file.

juanluisbaptiste commented 7 years ago

Here's the docker-compose file https://github.com/juanluisbaptiste/docker-otrs/blob/master/docker-compose-prod.yml

shadowguardian507-irl commented 7 years ago

Thanks for that, I did not know you could just drop the variables directly into the .yml file for your docker containers. The containers now start however I appear to have a problem with the OTRS container being able to connect to the db container running " docker-compose up " results in

Starting dockerotrs_data-otrs_1 Starting dockerotrs_data_1 Starting dockerotrs_mariadb_1 Starting dockerotrs_otrs_1 Attaching to dockerotrs_data-otrs_1, dockerotrs_data_1, dockerotrs_mariadb_1, dockerotrs_otrs_1 mariadb_1 | 161002 11:20:53 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'. mariadb_1 | 161002 11:20:53 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql dockerotrs_data-otrs_1 exited with code 0 otrs_1 | [INFO] Enter otrs_1 | [WARNING] DB server still isn't up, sleeping a little bit ... dockerotrs_data_1 exited with code 0 otrs_1 | [INFO] Enter otrs_1 | [WARNING] DB server still isn't up, sleeping a little bit ... otrs_1 | [INFO] Enter otrs_1 | [WARNING] DB server still isn't up, sleeping a little bit ... otrs_1 | [INFO] Enter otrs_1 | [WARNING] DB server still isn't up, sleeping a little bit ...

here is my docker-compose.yml file (don't worry about the passwords etc in it I will change those once I have it working)

https://gist.github.com/shadowguardian507-irl/62c2b172248267d2fc8e30810f6054b8

note the docker-compose.yml file is the only thing I have changed all the rest of the files are exactly as provided in the repo.

note the db container does come up as I can connect to it (from the docker host) using mysql -u root -h 172.18.0.3 (where the IP is found by using docker inspect on the DB container)

Franselbaer commented 7 years ago

Sadly i also never got it up and running. Everytime there's something wrong with the database regardless if is set a password or other env_variables.... :-(

Seems to have something to do with $mysqlcmd in run.sh or something....

I'll try to build my own instance....

juanluisbaptiste commented 7 years ago

Try this otrs-setup.env

OTRS_HOSTNAME=support.yourcompany.com
OTRS_ADMIN_EMAIL=admin@yourcompany.com
OTRS_ORGANIZATION="Your Company"
OTRS_ROOT_PASSWORD=changeme
MYSQL_ROOT_PASSWORD=changeme
OTRS_DB_PASSWORD=changeme

Those I think are the minimum required parameters, you can put them instead directly on the docker-compose.yml under environment: too if you want.

shadowguardian507-irl commented 7 years ago

sorry for the long delay in response.

I have tried a fresh copy of from your repo using the otrs-setup.env file you provided however I now get this error/behavior (the only change I made to the yml was to disable the smtp container)

capture

juanluisbaptiste commented 7 years ago

I recently added support for host mounted volumes, that error occurs on that case, and it clearly is telling you what the problem is: the directory on the host where the database container is mounting the mysql database directory has the wrong permissions. Do a

chown 27 /path/to/dbdir

I need to update the README.MD file to tell this.

shadowguardian507-irl commented 7 years ago

Thanks for that, changing the permissions fixed the issue with the mysql db eg 'chmod 777 ./volumes/mysql'

May I suggest that the docker-compose.yml and docker-compose-prod.yml file be changed so that their mariadb sections are like this

mariadb: build: context: mariadb expose:

  • "3306" volumes_from:
  • data env_file: otrs-setup.env

rather than this

mariadb: build: context: mariadb expose:

  • "3306" volumes_from:
  • data environment: MYSQL_ROOT_PASSWORD: changeme

so that changing the 'MYSQL_ROOT_PASSWORD' parameter in the otrs-setup.env applies to both the otrs and mariadb containers

juanluisbaptiste commented 7 years ago

Well I leave the variables inside the environment: section because its more clear for new comers. Any experienced user with docker will know how to use an env file anyways.

juanluisbaptiste commented 7 years ago

Sorry, I misunderstood you, you are right, looking at the current docker-compose-prod.yml file I see there is an inconsistency with that, I'll fix it.

juanluisbaptiste commented 7 years ago

I also updated the README.md file and added some info about the host-mounted containers.

xoroz commented 6 years ago

would be very nice to add the example otrs-setup.env to the github project file

juanluisbaptiste commented 6 years ago

Added an example file named .env.example, se the README file for details.