Docker Community Forums

Share and learn in the Docker community.

Docker-compose wordpress phpmyadmin user and password


(Nxtra) #1

I’m setting up a wordpress website with docker-compose.
I want to change the user which I can use to login at phpmyadmin.
Currently this is USER:wordpress PASSWORD:wordpress

How can I set this variables?

My current docker-compose.yml

version: '3.3'

volumes:
  data:
networks:
  back:

services:

  db:
    image: mysql:5.7
    volumes:
      - data:/var/lib/mysql
    environment:
       MYSQL_DATABASE: wordpress
       MYSQL_USER: admin
       MYSQL_PASSWORD: test
       MYSQL_ROOT_PASSWORD: test
    networks:
      - back

  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    ports:
      - 80:80
      - 443:443
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
    volumes:
      - ./html:/var/www/html
    container_name: site
    networks:
      - back

  phpmyadmin:
    depends_on:
      - db
    image: phpmyadmin/phpmyadmin
    restart: always
    ports:
      - 3001:80
    environment:
      PMA_HOST: db
    networks:
      - back

I am specifying WORDPRESS_DB_USER: wordpress and WORDPRESS_DB_PASSWORD: wordpress>
But as I understand it that is not where the user and password are created. Its to give wordpress db access. I want to change this to values that I choose. So that I can login at phpmyadmin with a password of my choosing. How can I change this user and password?


WordPress Container incl. FTP and PhpMyAdmin