Docker task which includes volumes, networks and yaml file and pushing dockerfile from your private repository

Write A docker compose file with nginx as front end Web server and Mongo as Backend DB server
Create one volume and bring up one container with volume attached to that container.
Create a docker network and bring up the two containers using docker-compose file in the same network and attach the host directory as a volume to the container.
Build a image from dockerfile and push that image to the private repository in the dockerhub.

Sounds like a good idea

Do u know how to do it?

It looks like you have an exercise for a class room situation. You should have been provided with all relevant details and been lectured about it.

This forum aims to help for self-help. You can show us what you tried and we can help you to spot mistakes, but we are not going to solve the exercise for you as it would not help you to actually learn something.

These documentations/descriptions should help to tackle this part of the exercise:

Here it depends HOW you want to build (docker build vs build: in compose) the image and whether you have access to a private repository on dockerhub.

Furthermore, if you want to learn and understand docker in depth, I highly recommend this free self-paced docker trainging: Introduction to Containers. It provides a solid foundation about the docker concept and how things are done in docker.