version: "3"

services:
  # Database
  db:
    image: mysql:8.1
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: kzwjjQd7T#9Pc35*
      MYSQL_DATABASE: redapple_ems
      MYSQL_USER: admin
      MYSQL_PASSWORD: hhZXUv*20g4v
    networks:
      - mysql-phpmyadmin

  # phpmyadmin
  phpmyadmin:
    depends_on:
      - db
    image: phpmyadmin
    restart: always
    ports:
      - "8080:80"
    environment:
      PMA_HOST: db
      MYSQL_ROOT_PASSWORD: kzwjjQd7T#9Pc35*
      UPLOAD_LIMIT: 1024000k
    networks:
      - mysql-phpmyadmin

networks:
  mysql-phpmyadmin:

volumes:
  db_data:
