Answer the question
In order to leave comments, you need to log in
How to port forward docker container with flask application to localhost windows network?
There is a windows system, on hyperv the docker creates a Linux system and creates a DockerNAT network. I'm running a container and forwarding port 5000 to the outside.
Where are the settings for creating this virtual machine stored? For at startup, it will automatically install dockernat and not external.
And is it possible to set up a network so that the containers are accessible via localhost?
Thanks in advance!
Docker last 17.09.1
And it's not entirely clear where it crashes. I run the command from the docker documentation examples
docker run -d -p 8876:80 --name webserver nginx
AND in the browser by typing localhost:8876 I get access to the nginx greeting By
starting the container from the image:
FROM python:latest
ENV PROJECT = /fileuploader
WORKDIR /fileuploader
ADD . /fileuploader
RUN pip install --trusted-host pypi.python.org -r requirements.txt
EXPOSE 5000
VOLUME ${PROJECT}
ENV FLASK_APP index.py
CMD ["flask","run"]
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3acd9709e8a4 45b9d430ff43 "flask run" 34 seconds ago Up 32 seconds 0.0.0.0:8877->5000/tcp pyfileuplo
3b7bdf132ff2 nginx "nginx -g 'daemon ..." 4 minutes ago Up 4 minutes 0.0.0.0:8876->80/tcp webserver
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question