MySQL connection from docker-compose and nginx reverse proxy

Hi,

I’m having an issue connecting to the DB from a docker image on a VPS.

I have a nginx reverse proxy with https to a virtual host pointing to the expose port 80, this works fine.

I want to use a custom db host so the host is not localhost nor mysql_leantime.localhost .

but the service is throwing this:

No database connection, check your database credentials in your configuration file.

How can I debug the db connection?

I’m using a modified version of your docker-compose.yml with this environment

- LEAN_DB_HOST=’[DB URL]:[DB PORT]’
- LEAN_DB_USER=’[DB USER]’
- LEAN_DB_PASSWORD=’[DB PASS]’
- LEAN_DB_DATABASE=’[DB NAME]’

I’ve checked the mysql connection with Mysql workbench, works fine.

I manage to fix my error with this.

I have to remove the simple quotes, so now is like this

- LEAN_DB_HOST=[DB URL]:[DB PORT]
- LEAN_DB_USER=[DB USER]
- LEAN_DB_PASSWORD=[DB PASS]
- LEAN_DB_DATABASE=[DB NAME]

Now the platform is working.

The new problem is on the rendering, I’m getting something funny. Like divs are missing or something, I’ll dig a little on that

Update:

Console report Blocked loading mixed content, it seems that the css is loaded with http

I’ll try with protocol relative links.

How can I change the behavior of <?=BASE_URL?> to produce a protocol relative link ( //<HOST URL>/<CONTENT PATH> ) ?

I’ve test that using protocol relative links works, but I can’t find an easy way to change the base url, replacing all literals works, but is not maintainable.

How can I change the behavior of <?=BASE_URL?> to produce a protocol relative link ( //<HOST URL>/<CONTENT PATH> ) ?

Any help will be very welcome