I am building a docker container for a django application, which uses nginx and uwsgi. For the Database the application is using mysql, which is located in a different container and both of them are link with a docker-compose.yml
file:
version: '2'
services:
mysql:
image: mysql:latest
environment:
-MYSQL_DATABASE: TheDatabase
-MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
-MYSQL_USER: TheUsername
-MYSQL_PASSWORD: ThePassword
ports:
-"3306:3306"
django:
build: .
volumes:
- .:/app
ports:
- "443:443"
- "8000:8000"
links:
- mysql
I am using SSL certificates, which are self-signed using OpenSSL and are included in the nginx.conf file. The problem is that every time I run the containers and try to log as the superuser I get the following error 504 Timed Out. After a decent amount of thinking I came to the conclusion that the issue is in the connection to the mysql database. I did enter the mysql container and saw that the Database is there and after inspecting the tables, I saw that all the tables have been created. However, after reading the logs I noticed the following line:
[Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key.
How am I supposed to add the SSL key and certificate, when I am using a ready image from the docker hub? Is that why I getting the 504 Timed out error? I am also getting the following 3 Warnings:
[Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
[Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
[Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode