This is possible with docker-compose with ARGS inside Dockerfile.
Problem to Solve:
Pull changes from Git Respository, to Automate App Deploy
Dockerfile
RUN
ARG CACHEBUST=1 # This will setup a arg called CACHEBUST
RUN git clone
Run the below bash command to build and run. SETTING --build-arg CACHEBUST= random md5sum hash, makes Docker-Compose to rebuild the image, starting the line with ARGS and so on.
docker-compose -f dockerprd.yml build --build-arg CACHEBUST=$(echo $RANDOM | md5sum | head -c 20; echo;) && docker-compose -f dockerprd.yml up -d