From docs: "Run command with the service's ports enabled and mapped to the host." https://docs.docker.com/compose/reference/run/
Also, for anybody wondering about "synchronization" solutions, I have found dockerize to be very useful. https://github.com/jwilder/dockerize