Is there a way if using EFS or persistence volume with ECS fargate service
Normally, its not good practice to mount a foreign volume from within a Docker container….they should be transient and where persistence is needed, you’d normally use a local path on the Docker server host. Fargate makes things more interesting since you don’t manage the Docker server host. AWS specifically says that Fargate task storage is ephemeral…kind of treat containers on Fargate as stateless.
Depending on your need for persistence, you could build storage into your container app to save stuff to Dynamo, RDS or S3. I have seen people using a script to download and upload data from their ECS Fargate-managed container to S3 for persistence. You can find a few example out on StackExchange and Github.
Regarding ECS service only EC2 instances can support persistent volumes (docker volumes), Fargate currently is out of scope.
Fargate now supports persistent storage using EFS volumes [https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html]