Error image docker strapi|

System Information
  • Strapi Version: 3.6.1
  • Operating System: Windows 10
  • Database: Mysql
  • Node Version: 14.16.1
  • NPM Version: 6.14.12
  • Yarn Version: not used

It looks like you’re trying to connect to a database in the Strapi image (127.0.0.1 is local to the docker container, not the PC). I don’t think the strapi/strapi image contains a MySQL instance.

Consider using docker-compose and using “db” as a service. Or connect separate db and strapi containers to the same Docker network.

I wanted to connect to a local database but external to the image and with the configuration I couldn’t, but I solved it by using DATABASE_HOST: host.docker.internal.