This is my docker-compose.yml
version: \'2\' services: wordpress: image: wordpress ports: - \"8080:80\" environment: WORDPRESS_DB_P
Adding these under 'db:' solved it for me.
command: --default-authentication-plugin=mysql_native_password restart: always