prevention-point icon indicating copy to clipboard operation
prevention-point copied to clipboard

Demo deploy

Open machow opened this issue 5 years ago • 1 comments

This PR allows the app to run on hosts that are not localhost. There were two main issues: Django is not set to accept any hosts, and in prod it's both accessible via nginx (good) and a port straight to the app server (bad? probably not a big issue).

Changes:

  • set django ALLOW_HOSTS = ['*'], remove host-exposed backend port.
  • comment out dev settings in docker-compose.yml (eg nginx config bind mount; exposing backend port on host since it is accessed via nginx)

Note: I also commented out parts of nginx while trying to figure out how to get non localhost hosts working. Could likely uncomment again!

        #proxy_set_header   X-Real-IP $remote_addr;
        #proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        #proxy_set_header   X-Forwarded-Host $server_name;

machow avatar Apr 14 '20 19:04 machow

This PR reminded me that there are some django specific production things that should be done.

however, does this apply when it is inside a docker container?

  • debug should be set to false in settings/poduction
  • secret key should be an env variable?

MikeyManoguerra avatar Apr 14 '20 21:04 MikeyManoguerra