Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

371
Views
Keep an Nginx alive after a bash script

I'm currently trying to execute a bash script inside my Nginx container and then keeping it alive of course.

So, my idea was to do what I need to in the bash script and as the last command, the command found with a docker-compose ps. But the container keeps shutting down. Here is a summary of what I currently have

The Dockerfile

FROM nginx:latest

COPY ./run.sh /root/run.sh
RUN ["chmod", "+x", "/root/run.sh"]

CMD ["/root/run.sh"]

run.sh

#!/bin/bash
nginx -g daemon off;

Am I missing something?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You need to use: nginx -g "daemon off;", with the option quoted.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!