How to store messages in /mosquitto/data MQTT mosquitto?

I am running Docker in AWS ECS and inside the docker container in ECS instance i am running eclipse-mosquitto

I need to store the messages in /mosquitto/data

What i tried

docker exec -it [container name] sh navigated to /mosquitto/config/mosquitto.conf

Modified the mosquitto.conf file and added these lines :

persistence true
persistence_location /mosquitto/data/
listener 1883
listener 9001
protocol websockets

What i expect

Whenever i am publishing/subscribing to a topic it should store the relevant data under mosquitto/data

Source: StackOverflow