Versions Compared

Key

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

...

Code Block
version: '3'
 
services:
  db:
    image: mysql:5.7
    container_name: db
    environment:
      MYSQL_ROOT_PASSWORDDATABASE: my_secret_passworddaselement
      MYSQL_DATABASEROOT_PASSWORD: approot_dbpassword
      MYSQL_USER: db_user
      MYSQL_PASSWORD: db_user_pass
    ports:
      - 3306:3306
    volumes:
      - dbdata:/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:
  dbdata:.

Run this command to start the database:

...