1 year ago
#373022
An old man in the sea.
Running gunicorn from dockerfile not working, but not showing in interactive bash
In this dockerfile, we have:
EXPOSE 5000
RUN gunicorn --bind 0.0.0.0:5000
RUN /usr/sbin/nginx
However, when I do from docker running image:
root@594ac39e8115:/# ps -x
I get
PID TTY STAT TIME COMMAND
1 pts/0 Ss 0:00 bash
10 pts/0 R+ 0:00 ps -x
But if I run:
root@594ac39e8115:/# gunicorn --bind 0.0.0.0:5000 && /usr/sbin/nginx
I get:
PID TTY STAT TIME COMMAND
1 pts/0 Ss 0:00 bash
15 ? S 0:00 /usr/bin/python3 /usr/local/bin/gunicorn --bind 0.0.0.0:5000
16 ? Ss 0:00 nginx: master process /usr/sbin/nginx
26 ? S 0:02 /usr/bin/python3 /usr/local/bin/gunicorn --bind 0.0.0.0:5000
27 ? S 0:02 /usr/bin/python3 /usr/local/bin/gunicorn --bind 0.0.0.0:5000
28 ? S 0:02 /usr/bin/python3 /usr/local/bin/gunicorn --bind 0.0.0.0:5000
29 ? S 0:02 /usr/bin/python3 /usr/local/bin/gunicorn --bind 0.0.0.0:5000
314 pts/0 R+ 0:00 ps -x
And the app replies to curl requests.
Why isn't the dockerfile able to correctly initialize the gunicorn instances and nginx reverse proxy server?
docker
nginx
gunicorn
0 Answers
Your Answer