http://stackoverflow.com/q/25909985/707580
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:
/var/www/app/
appl/
static/
...
app.py
wsgi.py
Before using docker, I used nginx to point directly to static files:
location /static {
alias /var/www/www.domain.com/appl/static;
}
location / {
uwsgi_pass unix:///tmp/uwsgi/www.domain.com.sock;
include uwsgi_params;
}
But now the static file is inside the container and nginx cannot see it.
I can think of two solutions:
-
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
-
The
(host)/var/www/www.domain.com/static
Hang 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.