skip to Main Content

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!

3

Answers


  1. 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

    Login or Signup to reply.
  2. 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
    
    Login or Signup to reply.
  3. you can Try in your image

    phpmyadmin:
        image: phpmyadmin/phpmyadmin
        ports:
          - '8080:80'
        restart: always
        environment:
          PMA_HOST: mysql
        depends_on:
          - mysql
        networks:
          - mysql_network
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search