Create a single container instead of 3 different containers

I saw you were setting up a Docker-compose file but it which creates 3 different containers but wanted to combine those 3 containers to a single container/image instead of setting it up as multiple containers at deployment system.
list of containers are as follow :
1 my main container containing my code that I built using Docker File
rest 2 are containers of Redis and Postress but wanted to combine them in 1 is there any way to do so ?

Source: Docker Questions