'mkdir(): Permission denied error in php docker nginx

Im getting mkdir(): Permission denied error in dockerised php.

I need to create folder dynamically inside /app ,

tried with mkdir('/app/images/' 0777, true)

chown for particular folder is www-data:www-data

Please see the excerpt from docker composer file

    php:
        build:
            context: .
            dockerfile: PHP.Dockerfile
        volumes:
            - ./app:/app
            - ./php.ini:/usr/local/etc/php/conf.d/custom.ini



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source