How does docker support both static and dynamic content

  docker, question
Ask both sides to see which side has more docker.

I have a simple python/flask app that is deployed on the container like this:


Before using docker, I used nginx to point directly to static files:

location /static {
 alias  /var/www/;
 location / {
 uwsgi_pass unix:///tmp/uwsgi/;
 include uwsgi_params;

But now the static file is inside the container and nginx cannot see it.

I can think of two solutions:

  1. According to the same configuration as before, card a nginx in docker, then let host nginx and container nginx connect directly through 8000 ports, host nginx is a pure proxy

  2. The(host)/var/www/ on(container)/var/www/static, and then copy the static content in the startup script

What is docker’s method?

More docker’s method is to plant a nginx in it.

Docker’s goal is that the program written now will be able to run in 10 years, in other words, the whole environment will be packaged.