PostgreSQL -- run Supervisord on Ubuntu in Docker
I tried to use the supervisor to start nginx and PostgreSQL on the docker container boot. Use the following Dockerfile and supervisord. conf files. The above application starts, but stops after a moment. What's wrong? There is no error message in the stderr or system log file.
Dockerfile:
1. [Code] [text]
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-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:
2. [Code] [text]
[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/s-D/var/pgsql/data"
Stdout_logfile =/var/log/pgsql/% (program_name) s. log
Stderr_logfile =/var/log/pgsql/% (program_name) s. log
-------------------------------------- Solution --------------------------------------------
You should:
Use the-n option to run supervisord on the foreground.
Use ENTRYPOINT in Dockerfile instead of CMD.
------------------------------------ Lili split line ------------------------------------
Install PostgreSQL 6.3 on yum in CentOS 9.3
PostgreSQL cache details
Compiling PostgreSQL on Windows
Configuration and installation of LAPP (Linux + Apache + PostgreSQL + PHP) Environment in Ubuntu
Install and configure phppgAdmin on Ubuntu
Install PostgreSQL9.3 on CentOS
Configure a Streaming Replication cluster in PostgreSQL
How to install PostgreSQL 7/6 and phpPgAdmin in CentOS 5/6. 4
------------------------------------ Lili split line ------------------------------------
PostgreSQL details: click here
PostgreSQL: click here
This article permanently updates the link address: