services:
    # image project
    app:
        build:
            context: .
            dockerfile: Dockerfile
        restart: unless-stopped
        working_dir: /var/www/
        volumes:
            - ./:/var/www
        depends_on:
            - redis
        networks:
            - laravel

    # nginx
    nginx:
        image: nginx:alpine
        restart: unless-stopped
        ports:
            - "8989:80"
        volumes:
            - ./:/var/www
            - ./docker/nginx/:/etc/nginx/conf.d/
        networks:
            - laravel

    # db mysql
    db:
        image: mysql:8.0
        restart: unless-stopped
        environment:
            MYSQL_DATABASE: soupequenoempr_marianeruch
            MYSQL_ROOT_PASSWORD: root
            MYSQL_PASSWORD: "$8(%vQ_YRIdq"
            MYSQL_USER: soupequenoempr_admin
        volumes:
            - ./.docker/mysql/dbdata:/var/lib/mysql
        ports:
            - "3388:3306"
        networks:
            - laravel

    # PHPMyAdmin
    phpmyadmin:
        image: phpmyadmin/phpmyadmin
        restart: unless-stopped
        ports:
            - "8080:80"
        environment:
            PMA_HOST: db
            PMA_PORT: 3306
            MYSQL_ROOT_PASSWORD: root
        networks:
            - laravel

    # redis
    redis:
        image: redis:latest
        networks:
            - laravel

networks:
    laravel:
        driver: bridge
