version: '3.5'

services:
    web:
        container_name: php-trello-integration-app-web
        env_file:
            - .env
        depends_on:
            - db
        build:
            dockerfile: ./sample-apps/trello-integration-app/Dockerfile
            context: ../../
        ports:
            - 8999:80
        environment:
            DB_HOST: db
            DB_NAME: trello
            DB_USERNAME: hubspoter
            DB_PASSWORD: 1234
        volumes:
            - ./src:/app/src
            - ./sql:/app/sql
    ngrok:
        container_name: php-trello-integration-app-ngrok
        image: gtriggiano/ngrok-tunnel
        ports:
            - 4040:4040
        environment:
            TARGET_HOST: web
            TARGET_PORT: 80
        depends_on:
            - web
    db:
        container_name: php-trello-integration-app-db
        image: mysql:8.0
        command: mysqld --default-authentication-plugin=mysql_native_password
        volumes:
            - ./db/mysql:/var/lib/mysql
        ports:
            - 3306:3306
        logging:
          driver: none
        environment:
            MYSQL_ROOT_PASSWORD: root
            MYSQL_DATABASE: trello
            MYSQL_USER: hubspoter
            MYSQL_PASSWORD: 1234
