Docker deployment django web page

there are many examples related to the deployment of django. The way I deploy is nginx + gunicorn + django, where gunicorn communicates with app by visiting wsgi. So the problem is, when I deploy through docker, I don"t use gunicorn, at all, so Wang Ye can still access it? Why?

docker run -it -p 80:80 xxxx(tagname)
web
python3 manage.py runserver 0.0.0.0:80

with this sentence, I can access my own interface on the website, so why can I visit gunicorn even if I don"t use it?

Dec.09,2021

because of your command

python3 manage.py runserver 0.0.0.0:80

is equivalent to running a temporary server locally, which can only provide services within the local area network, and is unstable. Generally speaking, when we are in development mode, we use this way to quickly view the debugging results of our code

in the actual production environment, we need to deal with more complex problems, such as static file processing, security, efficiency, and so on. Most of them use the uwsgi+Nginx mode for production deployment.

Menu