I create Docker container for MariaDB database and phpMyAdmin.
When i run the container use Docker Compose i cannot access the phpMyAdmin web on http://localhost:8080
Here is my docker-compose.yml
version: '3.8'
services:
database:
container_name: database
image: mariadb:10.5.8-focal
restart: always
ports:
- 3307:3306
environment:
MYSQL_ROOT_PASSWORD: secret
volumes:
- ./data:/var/lib/mysql
- ./entrypoint:/docker-entrypoint-initdb.d
networks:
- db-network
phpmyadmin:
container_name: phpmyadmin
image: phpmyadmin:5.0.4-fpm-alpine
restart: always
ports:
- 8080:80
environment:
PMA_HOST: database
PMA_USER: root
PMA_PASSWORD: secret
depends_on:
- database
networks:
- db-network
networks:
db-network:
name: db-network
question from:
https://stackoverflow.com/questions/65867015/cannot-access-phpmyadmin-web-on-docker-dekstop-wsl2 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…