version: '3'

services:
    web:
        build: .
        ports:
            - 8000:80
        volumes:
            - ./:/var/www/html
            - ./docker/php.ini:/usr/local/etc/php/conf.d/php.ini
            - ./docker/apache.conf:/etc/apache2/sites-available/000-default.conf
        working_dir: /var/www/html
        depends_on:
            - db
    db:
        image: mysql:5.7.29
        volumes:
            - db_data:/var/lib/mysql
        ports:
            - 3306:3306
        environment:
            MYSQL_DATABASE: ci4
            MYSQL_USER: ci4user
            MYSQL_PASSWORD: ci4pass
            MYSQL_ROOT_PASSWORD: ci4pass
    phpmyadmin:
        image: phpmyadmin/phpmyadmin:latest
        ports:
            - 8001:80
        environment:
            PMA_USER: ci4user
            PMA_PASSWORD: ci4pass
            PMA_HOST: db
volumes:
    db_data: