By default, docker-compose run
does not publish the service’s ports. You can either pass the --service-ports
option to publish the ports as they are defined in the docker-compose.yml, or use the -p
option to publish all ports.
See the documentation for docker-compose run