Running Supervisord on Ubuntu in Docker

I’m trying to use supervisor to start nginx and postgresql on boot of a docker container. Using the following Dockerfile and supervisord.conf files, the aforementioned applications start but moments later stop. Does anyone know what could be wrong? There are no error messages to stderr or system log files.

Dockerfile:

  • Boot2docker i/o timeout when opening a new terminal session in MacOs X
  • Links between service Rancher Server 1.0.0
  • Does anyone have a working trivial example of a Dockerfile & command line that mount an external directory from linux into the docker image?
  • how to import a file as a parameter in Docker?
  • Overlay network aware HAProxy
  • EADDRNOTAVAIL when Dockerizing Node.js app
  • FROM ubuntu:14.04
    RUN mkdir -p /var/www /var/pgsql/data /var/log/pgsql /var/log/nginx
    COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
    COPY nginx.conf /etc/nginx/sites-enabled/default
    RUN apt-get -y update && apt-get -y upgrade
    RUN apt-get -y install curl wget supervisor postgresql postgresql-contrib libpq-dev llvm gcc g++ python3-pip python2.7 pytho
    n2.7-dev python-pip git nginx nodejs openjdk-7-jdk build-essential
    RUN apt-get -y clean all
    EXPOSE 80 8000 8080
    CMD ["/usr/bin/supervisord"]
    

    supervisord.conf:

    [supervisord]
    nodaemon=true
    
    [program:nginx]
    command=/bin/bash -c "exec /usr/sbin/nginx -DFOREGROUND"
    stdout_logfile=/var/log/nginx/%(program_name)s.log
    stderr_logfile=/var/log/nginx/%(program_name)s.log
    
    [program:postgresql]
    command=/bin/bash -c "exec /usr/lib/postgresql/9.3/bin/postgres -D /var/pgsql/data"
    stdout_logfile=/var/log/pgsql/%(program_name)s.log
    stderr_logfile=/var/log/pgsql/%(program_name)s.log
    

  • How can I detect if a tcp connection has been forwarded from a ssl connection?
  • Fetching AWS instance metadata from within Docker container?
  • unexpected “permission denied” with 3.13 host
  • Why is the Docker vfs storage backend not considered suitable for production?
  • Docker. npm install -> Error: getaddrinfo ENOTFOUND
  • How can I run bash in a new container of a docker image?
  • One Solution collect form web for “Running Supervisord on Ubuntu in Docker”

    You should:

    1. Run supervisord in the foreground use -n option.
    2. Use ENTRYPOINT instead of CMD in Dockerfile.
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.