Port Publishing When Running with Docker Compose
问题 I can't seem to work out a way to get port publishing to work with docker-compose run in the same way as I can with docker run . Using Docker Compose (and therefore the port mapping in docker-compose.yml ) gives a "Failed to connect" error from curl : $ docker-compose run flask * Running on http://0.0.0.0:2048/ (Press CTRL+C to quit) $ curl http://localhost:2048/ curl: (7) Failed connect to localhost:2048; Connection refused However, things are fine when manually passing the ports to docker