services:
    app:
        build: .
        ports:
            - "8080:80"
        volumes:
            - .:/var/www/html
            - kms_vendor:/var/www/html/vendor
        depends_on:
            - mysql
            - redis
        environment:
            - APP_ENV=local
            - DB_HOST=mysql
            - DB_PORT=3306
            - DB_DATABASE=kms_new
            - DB_USERNAME=kms
            - DB_PASSWORD=kms_secret
            - REDIS_HOST=redis

    mysql:
        image: mysql:8.0
        ports:
            - "3308:3306"
        environment:
            MYSQL_ROOT_PASSWORD: root_secret
            MYSQL_DATABASE: kms_new
            MYSQL_USER: kms
            MYSQL_PASSWORD: kms_secret
        volumes:
            - kms_mysql_data:/var/lib/mysql
        command: >
            --default-authentication-plugin=mysql_native_password
            --character-set-server=utf8mb4
            --collation-server=utf8mb4_unicode_ci
            --sql-mode=""
            --innodb-buffer-pool-size=512M

    redis:
        image: redis:7-alpine
        ports:
            - "6380:6379"

    phpmyadmin:
        image: phpmyadmin/phpmyadmin
        ports:
            - "8082:80"
        environment:
            PMA_HOST: mysql
            PMA_USER: root
            PMA_PASSWORD: root_secret

volumes:
    kms_mysql_data:
    kms_vendor:
