【发布时间】:2015-08-24 10:56:26
【问题描述】:
我目前有 supervisor 为我的 Django 应用程序提供服务,然后我在 Docker 文件中的端口 8002 上使用 expose。这一切正常...
[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
在 Docker 中
# Expose listen ports
EXPOSE 8002
但是,有人告诉我最好在端口上使用socket,但是我不确定如何在我的 Docker 文件中“公开”套接字。这是我已经走了多远:
新的主管配置....
backlog = 2048
chdir = "/var/projects/apps"
bind = "unix:/var/run/webapp/gunicorn.sock"
pidfile = "/var/run/webapp/gunicorn.pid"
daemon = False
debug = False
码头工人
# Expose listen ports
EXPOSE ???? (may be unix:/var/run/webapp/gunicorn.sock fail_timeout=0;???)
如何暴露套接字?
【问题讨论】:
-
@satoru 那就是使用 RUN 命令。