Seafile Pro Docker can't read environment variables from docker-compose

Hi,
I upgraded my Seafile CE to the Pro version using Docker. After doing so, the main Seahub container started with the error: “Can’t connect to MySQL server on ‘127.0.0.1’ ([Errno 111] Connection refused”. Something strange was happening because I specified the string "DB_HOST=db"in my docker-compose.yml so Seafile shouldn’t try to connect to localhost. I entered in the container by opening a bash console and tested the connection to the db manually, installing the mysql binary from apt. I was able to succesfully connect to my db. Then I digged in the config file and found the /script/utils/init.py. In this file there is the code:

Blockquote
def wait_for_mysql():
db_host = get_conf(‘DB_HOST’, ''127.0.0.1")
db_user = ‘root’
db_passwd = get_conf(‘DB_ROOT_PASSWD’, ‘’)

I tried to edit manually the default parameters after DB_HOST and DB_ROOT_PASSWD, specifyng the "db"and my root password. I restarted the container and Seafile began to work as it should. Does anyone know why the container can’t read the variables passed by the docker-compose file?
Thanks

Wrong compose file. Solved myself

I am having a similar problem. Can you elaborate on your solution? What was “wrong” about the compose file?

Hi,
It was a dumb mistake, I missed the “environment” section of the compose file, I put everything under “volume”.