###############################################################################
#                          Generated on phpdocker.io                          #
###############################################################################
version: '3.1'
services:
    mariadb:
        image: 'mariadb:11.0'
        working_dir: /application
        volumes:
            - '.:/application'
        environment:
            - MYSQL_ROOT_PASSWORD=root
            - MYSQL_DATABASE=personal_fitness
            - MYSQL_USER=user
            - MYSQL_PASSWORD=password
        ports:
            - '3307:3306'

    webserver:
        image: 'nginx:alpine'
        working_dir: /application
        volumes:
            - '.:/application'
            - './phpdocker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf'
        ports:
            - '80:80'

    php-fpm:
        build: phpdocker/php-fpm
        working_dir: /application
        volumes:
            - '.:/application'
            - './phpdocker/php-fpm/php-ini-overrides.ini:/etc/php/8.3/fpm/conf.d/99-overrides.ini'
            - './phpdocker/php-fpm/php-ini-overrides.ini:/etc/php/8.3/cli/conf.d/99-overrides.ini'
        environment:
            PHP_IDE_CONFIG: "serverName=Docker"
        depends_on:
            - mariadb
        command: >
            sh -c "
                sleep 10 &&
                php artisan key:generate &&
                php artisan migrate &&
                php-fpm
            "
