Home > Mobile >  Can't open phpmyadmin on browser with Docker
Can't open phpmyadmin on browser with Docker

Time:03-28

I have created a docker-compose.yml file with the following parameters:

version: '3'
services:
 php:
  build: ./docker/images/php
  ports:
   - 80:80
  volumes:
   - ./htdocs:/var/www/html
  container_name: php
  networks:
   - default
 
 mysql:
  image: mysql:latest
  container_name: mysql
  environment:
   MYSQL_ROOT_PASSWORD: dani
   MYSQL_DATABASE: mysql_database
   MYSQL_USER: dani
   MYSQL_PASSWORD: dani
  ports:
   - "3306:3306"
  volumes:
   - ./dbdata:/var/lib/mysql
  networks:
   - default
 
 phpmyadmin:
  image: phpmyadmin/phpmyadmin
  container_name: phpmyadmin
  ports:
   - 8080:8080
  environment:
   - PMA_HOST=mysql
  networks:
   - default
      
networks:
 default:

This is the console output:

But, when I try to go to localhost:8080 :

I can't see phpmyadmin dashboard. What can I do?

Thanks!

CodePudding user response:

you can change for image and port by this code:

 phpmyadmin:
  image: phpmyadmin:latest
  container_name: phpmyadmin
  restart: always
  ports:
   - 8080:80
  environment:
   - PMA_HOST=mysql
  networks:
   - default

May be just it for your problem, good luck

CodePudding user response:

you have specified the wrong port in the phpmyadmin service, you've to map from 8080 to 80 where the application && try this environement also

Change the port & Env with this one:

ports:
  - 8080:80
environment:
  - PMA_ARBITRARY=1
  • Related