version: '3.7'
services:
  mariadb:
    image: 'bitnami/mariadb:latest'
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
    volumes:
      - 'mariadb_data:/bitnami'
    ports:
      - '3306:3306'
  phpmyadmin:
    image: 'phpmyadmin/phpmyadmin:latest'
    container_name: phpmyadmin
    environment:
      - PMA_HOST=mariadb
      - PMA_USER=root
    ports:
      - 8080:80
    volumes:
      - /sessions
  mysql:
    image: bitnami/mysql:8.0
    environment:
      ALLOW_EMPTY_PASSWORD: 'yes'
      MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password
    volumes:
      - 'mysql_data:/bitnami'
    ports:
      - '3306:3306'
  phpmyadmin-mysql:
    image: 'phpmyadmin/phpmyadmin:latest'
    container_name: phpmyadmin-mysql
    environment:
      - PMA_HOST=mysql
      - PMA_USER=root
    ports:
      - 8082:80
    volumes:
      - /sessions
  postgres:
    image: postgres:12.3
    environment:
      POSTGRES_DB: postgres
      POSTGRES_USER: admin
      POSTGRES_PASSWORD: secret
      PGDATA: /var/lib/postgresql/data
    volumes:
      - postgres_data:/var/lib/postgresql/data
    ports:
      - "5432:5432"
  pgadmin:
    image: dpage/pgadmin4:4.18
    environment:
      PGADMIN_DEFAULT_EMAIL: admin@localhost.dev
      PGADMIN_DEFAULT_PASSWORD: secret
      PGADMIN_LISTEN_PORT: 80
    ports:
      - "8081:80"
    volumes:
      - pgadmin_data:/var/lib/pgadmin
    links:
      - "postgres:pgsql-server"
volumes:
  postgres_data:
    driver: local
  pgadmin_data:
    driver: local
  mariadb_data:
    driver: local
  mysql_data:
    driver: local
  phpmyadmin_data:
    driver: local
