LMSouq
server-admin Open

How to run Nginx within a Docker container without halting?

SE
Seldo
1 month ago
3 views
Problem Description
I have Nginx installed on a Docker container, and am trying to run it like this: docker run -i -t -p 80:80 mydockerimage /usr/sbin/nginx The problem is that the way Nginx works, is that the initial process immediately spawns a master Nginx process and some workers, and then quits. Since Docker is only watching the PID of the original command, the container then halts. How do I prevent the container from halting? I need to be able to tell it to bind to the first child process, or stop Nginx's initial process from exiting.

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base