Jaeyson
Jaeyson

Reputation: 586

phpmyadmin:fpm-alpine docker cant reach on localhost

I tried using numerous samples of docker-compose.yml here on SO and github and it returns site can't be reached.

Here's what im currently using:

version: "3"

services:
  mysql:
    image: mysql:5.7.29
    container_name: mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_USER: mysql
      MYSQL_PASSWORD: mysql
    ports:
      - "3306:3306"

  phpmyadmin:
    image: phpmyadmin/phpmyadmin:fpm-alpine
    container_name: phpmyadmin
    restart: always
    ports:
      - "8085:80"
    environment:
      PMA_HOST: mysql
      PMA_USER: mysql
      PMA_PASSWORD: mysql

I tried also:

docker run --rm -e MYSQL_ROOT_PASSWORD=root -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -p 3306:3306 --name db mysql:5.7.29

docker run --rm -e PMA_HOST=db -e PMA_USER=mysql -e PMA_PASSWORD=mysql -p 8085:80 --name phpmyadmin phpmyadmin/phpmyadmin:fpm-alpine

did I missed any options/args?

Upvotes: 5

Views: 4377

Answers (1)

noctrex
noctrex

Reputation: 146

When using the "phpmyadmin:fpm-alpine" container, you must manually provide a web-server, like nginx to serve the content, because it doesn't include a webserver. You can configure it as it has been discussed here.

If you don't want to use and configure additional containers, just use the "phpmyadmin:latest" container, which includes apache and can serve the content by itself.

Upvotes: 13

Related Questions