Docker Community Forums

Share and learn in the Docker community.

WARNING: The CGR_MYSQL_DATABASE variable is not set. Defaulting to a blank string

docker
build

(Agplacid) #1

Hi everyone,
I hope we are doing great today. Just trying to deep my hands into the docker world.
I am trying to compose a an opensource software using the yml file but I’m having all sorts of issues with the MYSQL environment.

I ran this command

docker-compose --project-name cgrates-fs-docker -f docker-compose.yml up --build

Here is the error message I’m getting:

WARNING: The CGR_MYSQL_DATABASE variable is not set. Defaulting to a blank string.
WARNING: The CGR_MYSQL_USER variable is not set. Defaulting to a blank string.
WARNING: The CGR_MYSQL_PASSWORD variable is not set. Defaulting to a blank string.
ERROR: The Compose file ‘./docker-compose.yml’ is invalid because:
services.mysql-cgr.environment contains {“MYSQL_ROOT_PASSWORD”: “xxxx”}, which is an invalid type, it should be a string

Here is the docker compose yml file

version: ‘3’
services:
cgrates:
build: cgrates
restart: always
environment:
- MYSQL_DATABASE=${CGR_MYSQL_DATABASE}
- MYSQL_USER=${CGR_MYSQL_USER}
- MYSQL_PASSWORD=${CGR_MYSQL_PASSWORD}
ports:
- 2080:2080
volumes:
- ./cgrates/tariffplan:/tariffplan
redis-cgr:
image: redis:latest
restart: always
command: redis-server
volumes:
- redis-cgr-data:/data
ports:
- 6379:6379
mysql-cgr:
build: mysql-cgr
restart: always
environment:
- MYSQL_ROOT_PASSWORD: “xxxx”
- MYSQL_DATABASE: grates
- MYSQL_USER: grates
- MYSQL_PASSWORD: xxxx
ports:
- 3306:3306
volumes:
- mysql-cgr-data:/var/lib/mysql
freeswitch-cgr:
build: freeswitch-cgr
restart: always
environment:
- FREESWITCH_DISABLE_NAT_DETECTION=false
- FREESWITCH_RTP_START_PORT=16384
- FREESWITCH_RTP_END_PORT=16584
- ERLANG_COOKIE=test-cookie
ports:
- 5060:5060/udp
- 16384-16584:16384-16584/udp
phpmyadmin:
environment:
- PMA_HOSTS=mysql-cgr
image: phpmyadmin/phpmyadmin
restart: always
ports:
- 4000:80
volumes:
mysql-cgr-data:
redis-cgr-data:

Can someone point out what I’m doing wrong for me?
Thanks