docker-compose up mounted folder read only issue

nginx.dockerfile

FROM nginx:stable-alpine

ADD ./nginx/nginx.conf /etc/nginx/nginx.conf
ADD ./nginx/default.conf /etc/nginx/conf.d/default.conf

RUN mkdir -p /var/www/html

RUN addgroup -g 1000 kasal && adduser -G kasal -g kasal -s /bin/sh -D kasal

RUN chown kasal:kasal /var/www/html

docker-compose.yml

version: "3"

networks:
  hanoo:

services:
  site:
    build:
      context: .
      dockerfile: nginx.dockerfile
    container_name: nginx
    ports:
      - "8080:80"
    volumes:
      - ./src:/var/www/html:delegated
    networks:
      - hanoo

Issue

I have been dealing this for several hours now. It builds successfully but when make up, it gives the following error.

➜  test_docker docker-compose up           
Removing nginx
Recreating 56cd6d9ffad0_nginx ... error

ERROR: for 56cd6d9ffad0_nginx  Cannot start service site: error while creating mount source path '/var/www/hanoo_dockers/test_docker/src': mkdir /var/www: read-only file system

ERROR: for site  Cannot start service site: error while creating mount source path '/var/www/hanoo_dockers/test_docker/src': mkdir /var/www: read-only file system
ERROR: Encountered errors while bringing up the project.

Source: Docker Questions