version: "3.7"

services:
    php:
        build:
            context: .
            dockerfile: .docker/php/Dockerfile
        volumes:
            - ./:/var/www/html
        ports:
            - "80:80/tcp"
            - "9002:9002/tcp"
        environment:
            - PHP_IDE_CONFIG=serverName=xdebug
        extra_hosts:
            - "host.docker.internal:host-gateway"
        networks:
            backend:
        depends_on:
            mysql:
                condition: service_healthy
    mysql:
        image: public.ecr.aws/docker/library/mysql:5.7.43
        command: mysqld --sql_mode=""
        volumes:
            - database:/var/lib/mysql
        ports:
            - "3306:3306"
        environment:
            MYSQL_ROOT_PASSWORD: rezo
            MYSQL_DATABASE: rezopartecsite
            MYSQL_USER: rezo
            MYSQL_PASSWORD: example
        networks:
            backend:
        healthcheck:
            test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD
            start_period: 5s
            interval: 5s
            timeout: 5s
            retries: 55

volumes:
    database:

networks:
    backend:
