version: '3.7'
services:
    mysql:
        container_name: roofind_mysql
        image: 'mysql:8.0'
        environment:
            - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
            - MYSQL_DATABASE=${MYSQL_DATABASE}
            - MYSQL_USER=${MYSQL_USER}
            - MYSQL_PASSWORD=${MYSQL_PASSWORD}
        ports:
            - "127.0.0.1:14101:3306"
        volumes:
            - ./dbfiles_roofind:/var/lib/mysql
#            - ./my.cnf:/etc/my.cnf
        restart: always

    api:
        image: nginx:1.23.1
        volumes:
            - ./backend:/application
            - ./docker/nginx/api.conf:/etc/nginx/conf.d/vhost.conf
        ports:
            - "127.0.0.1:14100:80"

        restart: always

    app:
        image: nginx:1.23.1
        volumes:
            - ./frontend:/frontend
            - ./docker/nginx/app.conf:/etc/nginx/conf.d/vhost.conf
        ports:
            - "127.0.0.1:14102:80"
        restart: always


    php-fpm:
        build: docker/php-fpm
        working_dir: /application
        volumes:
            - './backend:/application'
            - './docker/php-fpm/php-ini-overrides.ini:/etc/php/8.1/fpm/conf.d/99-overrides.ini'
            - './docker/ssmtp/ssmtp.conf:/etc/ssmtp/ssmtp.conf'
            - './docker/ssmtp/ssmtp.ini:/usr/local/etc/php/conf.d/ssmtp.ini'

