This example is taken and a tiny bit modified from the docker-compose example. In order for this to work on OS, the easiest way is to install boot2docker, and docker-compose.
Once you have it installed:
boot2docker up
eval "$(boot2docker shellinit)"
boot2docker ip
# This will print the IP address of the VM, so you can access the machine
docker-compose up