version: '2.4'
services:
  redis:
    image: redis:alpine
    container_name: pimcore-redis

  db:
    image: mariadb:10.4
    container_name: pimcore-mariadb
    working_dir: /application
    command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --innodb-file-format=Barracuda, --innodb-large-prefix=1, --innodb-file-per-table=1]
    volumes:
      - pimcore-database:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=ROOT
      - MYSQL_DATABASE=pimcore
      - MYSQL_USER=pimcore
      - MYSQL_PASSWORD=pimcore

  adminer:
    image: adminer
    ports:
      - 8080:8080

  php:
    image: pimcore/pimcore:PHP7.4-apache
    container_name: pimcore-php
    volumes:
      - .:/var/www/html:cached
    ports:
     - 80:80
     - 443:443
    depends_on:
     - db

  php-debug:
    image: pimcore/pimcore:PHP7.4-apache-debug
    container_name: pimcore-debug-php
    volumes:
      - .:/var/www/html:cached
    ports:
     - 88:80
    environment:
      - PHP_IDE_CONFIG="serverName=localhost"

volumes:
  pimcore-database:
