Pcharm Port Binding

I am running a flash application in a Docker container, so I need to bind the host and container ports (in this case, port 5000 in both).

Running this command:

docker run -v //c/Users/Nicholas/PycharmProjects/flask_tutorial:/opt/project -e "FLASK_APP=/opt/project/flaskr.py" -p 0.0.0.0:5000:5000 flask flask run --host=0.0.0.0

expands the container, and I can access the application at 127.0.0.1►000 locally in my browser. However, after entering the same settings in Pycharm (2016.2.3), launching the configuration GUI and launching the container, I can’t access the application (I tried to mark the option “Publish all ports” to no avail):

pycharm docker run configuration

Using docker inspect container_idwith the container created on the command line, I get these settings in NetworkSettings:

"Ports": {
    "5000/tcp": [
        {
            "HostIp": "0.0.0.0",
            "HostPort": "5000"
        }
    ]
},

However, with the Pycharm launch configuration container created, it did not seem to pass port bindings:

"Ports": {},

, Pycharm Docker? ?

Windows 10, Docker Hyper-V ( VirtualBox)

+4
1

EXPOSE Docker. .

0

Source: https://habr.com/ru/post/1658628/


All Articles