I am trying the connect mariadb with python using docker-compose:
docker-compose.yml
version: \'2\' services: mariadb: image: bitna
The problem is not with Database or Python code; Its a raise problem coming from Docker, as database needs some time to load and python (consumer.py) container launches faster than database one.
Possible solutions:
docker healthcheck
waittime in docker
add a delay to the python consumer