Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. create a new folder: database_mysql

  2. create a new text file inside the folder called: docker-compose.yml

  3. add this code snipped into the file …

Code Block
languageyaml
version: '3'
 
services:
  db:
    image: mysql:8
    container_name: db
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_ROOT_PASSWORD: password
      MYSQL_USER: dbuser
      MYSQL_PASSWORD: dbuser
    ports:
      - 3306:3306
    volumes:
      - mysql-data:/var/lib/mysql
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: pma
    links:
      - db
    environment:
      PMA_HOST: db
      PMA_PORT: 3306
      PMA_ARBITRARY: 1
    restart: always
    ports:
      - 8081:80
volumes:
    mysql-data:

...