I am quite new to Docker and I spent 3 days but still no luck on fixing this issue.
In short I am trying to spin up an environment of Magento 1.9 + mySQL + myphpadmin so I can restore my current legacy Magento project onto it.
Here is the image I use - https://hub.docker.com/r/alexcheng/magento
And I try to use docker-compose.yml for setting up the environment.
I keep changing my yml file by referencing different articles but when I connect to localhost for setting up DB connection, I keep getting error = Database connection.
I tried different combinations such as hostname = db or sqldb, port 3306 etc but still no luck.
For each time I respun up the environment, I completely removed the containers and volumes.
Here is the latest version of my yml
version: '3.0' services: web: image: alexcheng/magento:220.127.116.11 ports: - 80:80 depends_on: - slqdb volumes: - magento:/project/magento/www/html environment: - MYSQL_HOST=slqdb:3306 - MYSQL_DATABASE=db - MYSQL_USER=dba - MYSQL_PASSWORD=N5GfDp5wLsE3aK5q networks: - app-network slqdb: image: mysql:latest container_name: sqldb restart: always hostname: sqldb environment: MYSQL_DATABASE: db MYSQL_USER: dba MYSQL_PASSWORD: N5GfDp5wLsE3aK5q MYSQL_RANDOM_ROOT_PASSWORD: '1' volumes: - slqdb:/project/magento/mysql networks: - app-network phpmyadmin: image: phpmyadmin:latest restart: always ports: - 8081:80 environment: PMA_HOST: slqdb UPLOAD_LIMIT: 1024M depends_on: - slqdb networks: - app-network volumes: slqdb: magento: networks: app-network: driver: bridge
Thanks so much.