Im trying to make a docker-compose file which runs librenms and mysql.
currently my compose file looks like this:
version: '3.3' services: librenms: image: jarischaefer/docker-librenms restart: always environment: - APP_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - DB_HOST=172.16.98.10 - DB_NAME=librenms - DB_USER=librenms - DB_PASS=XXXXXXXXXXXXXXXXXXXXX - BASE_URL=http://172.16.98.10 - ENABLE_SYSLOG=True volumes: - /docker/containers/librenms/logs/:/opt/librenms/logs ports: - "80:80" - "514:514" - "514:514/udp" depends_on: - db db: image: mysql:latest restart: always environment: - MYSQL_DATABASE=librenms - MYSQL_USER=librenms - MYSQL_PASSWORD=XXXXXXXXXXXXXXXXXXX - MYSQL_ROOT_PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXXX ports: - "3306:3306" expose: - "3306" volumes: - /docker/containers/mysql/db/:/var/lib/mysql
The composer runs fine. My only problem is when i log in to the website it gives me “Unhandled MYSQL error ”
When i read the documentation for librenms found here:
it says i need to run:
Creating the tables
docker exec librenms setup_database
Creating an initial admin user
docker exec librenms create_admin
So my question is how best to do this? if it can be done at all?
Can i somehow automate a docker exec in my compose file or?