services:
    app:
        build:
            context: ..
            dockerfile: docker_dev/Dockerfile
        ports:
            - 8081:80
        environment:
          MYSQL_USER: root
          MYSQL_PASSWORD: example
          MYSQL_DATABASE: dragon_fire
          MYSQL_HOST: mysql
          MYSQL_PORT: 3306
        develop:
            watch:
                - path: ./
                  action: rebuild
                - path: ../www/composer.*
                  action: rebuild
                - path: ../www/
                  action: sync
                  target: /var/www/html
                  ignore:
                    - ../.git
                    - mysql_schema.sql
        volumes:
          - website_datavolume:/var/www/html/raw
          
    mysql:
        build:
            dockerfile: MysqlDockerfile
        # NOTE: use of "mysql_native_password" is not recommended: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password
        # (this is just an example, not intended to be a production configuration)
        command: --default-authentication-plugin=mysql_native_password
        restart: always
        environment:
          MYSQL_ROOT_PASSWORD: example
        ports:
          - 3306:3306
        develop:
            watch:
                - path: mysql_schema.sql
                  action: rebuild
        volumes:
            - sqlvolume:/var/lib/mysql
volumes:
    sqlvolume: {}
    website_datavolume: {}
