Im trying to set up a development version of a Django app that was provided to me. It is a very large application (and undocumented) and uses a dockerfile to build on dokku.
I’m not understanding how dokku manages nginx and container interactions. All I want to do is set up a http connection at my EC2 public ip address that serves my Django application.
Firstly why is it that when I deploy my app from my docker file on dokku, at the bottom it says app deployed to -> address:random_port. Is this random port the nginx port or the container port to communicate with?
Before messing with this my DOKKU_PROXXY_PORT was set to the random port and my port mapping was 80:5000. With these settings I would get the nginx welcome page or with port mapping 80:random_port I would time out.
Now I found instructions online that said to set DOKKU_PROXXY_PORT to 80, port mapping to http:80:5000 and the vhost to the public ip. I did this and I think it’s correct because now I’m getting a blue screen (which I think is caused by the workers constantly restarting because the redis HOST variable is throwing an error from the call in settings.py, I’m still looking into how to fix this as well).
So I guess I’m wondering if this is correct and how exactly this all is working with dokku? Why can I not set the domains-global to the ip instead of vhost, and why do some people online recommend not to use vhost? And does guinicorn automatically listen on 5000:5000(inside container:exposed to dokku) inside dokku (my settings say guinicorn is set to 8080 but logs say it’s using 5000). I’m really trying to make sense of all of this.
This is not a complete answer, but I can't add comments yet.
It has been a while, but dokku takes care of installing Nginx and setting up the reverse proxy for you. The proxy port is that of the container. But, at this stage, I would say don't worry about it unless you have something else running on that port.
In terms of domain, we only added per add, when deploying it
Dokku sets up the reverse proxy for you automatically, so whatever domain you added to your app would what your end-users access, but the content comes from the container.
The only thing I would suggest is SSL (Letsencrypt or your own): https://dokku.com/docs/deployment/application-deployment/#setting-up-ssl
Once you have got the hung of it, you can try copying their nginx template and customising it.