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

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 ‘’ ([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/ In this file there is the code:

def wait_for_mysql():
db_host = get_conf(‘DB_HOST’, ''")
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?

Wrong compose file. Solved myself

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

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