I currently have supervisor
serving my Django Application which I then expose
on port 8002
in my Docker file. This all works ok...
[program:app]
command=gunicorn app.core.wsgi:application -c /var/projects/app/server/gunicorn.conf
user=webapp
backlog = 2048
chdir = "/var/projects/apps"
bind = "0.0.0.0:8002"
pidfile = "/var/run/webapp/gunicorn.pid"
daemon = False
debug = False
In Docker
# Expose listen ports
EXPOSE 8002
However, I have been told it is better to use a socket
over a port but, I'm unsure how to "EXPOSE" a socket in my Docker file. This is how far I have got:
New supervisor config....
backlog = 2048
chdir = "/var/projects/apps"
bind = "unix:/var/run/webapp/gunicorn.sock"
pidfile = "/var/run/webapp/gunicorn.pid"
daemon = False
debug = False
Docker
# Expose listen ports
EXPOSE ???? (may be unix:/var/run/webapp/gunicorn.sock fail_timeout=0;???)
How do I expose the socket?