Closed shadowguardian507-irl closed 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.
Here's the docker-compose file https://github.com/juanluisbaptiste/docker-otrs/blob/master/docker-compose-prod.yml
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)
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....
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.
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)
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.
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
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.
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.
I also updated the README.md file and added some info about the host-mounted containers.
would be very nice to add the example otrs-setup.env to the github project file
Added an example file named .env.example, se the README file for details.
would it be possible to provide an example otrs-setup.env file, to ease use of the docker compose .yml files ?