PostgreSQL——在Docker中的Ubuntu上運行Supervisord

來源:互聯網
上載者:User

PostgreSQL——在Docker中的Ubuntu上運行Supervisord

我試圖使用supervisor啟動nginx和PostgreSQL,在docker container的boot上。使用下面的Dockerfile和supervisord.conf檔案,上述的應用程式啟動,但片刻之後停止。哪裡錯了?stderr或系統記錄檔中沒有錯誤訊息。
Dockerfile:

1. [代碼] [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 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. [代碼] [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/postgres -D /var/pgsql/data"
stdout_logfile=/var/log/pgsql/%(program_name)s.log
stderr_logfile=/var/log/pgsql/%(program_name)s.log

--------------------------------------解決方案--------------------------------------------

你應該:
使用-n選項在前台運行supervisord。
在Dockerfile中使用ENTRYPOINT,而不是CMD。

------------------------------------華麗麗的分割線------------------------------------

CentOS 6.3環境下yum安裝PostgreSQL 9.3

PostgreSQL緩衝詳述

Windows平台編譯 PostgreSQL

Ubuntu下LAPP(Linux+Apache+PostgreSQL+PHP)環境的配置與安裝

Ubuntu上的phppgAdmin安裝及配置

CentOS平台下安裝PostgreSQL9.3

PostgreSQL配置Streaming Replication叢集

如何在CentOS 7/6.5/6.4 下安裝PostgreSQL 9.3 與 phpPgAdmin 

------------------------------------華麗麗的分割線------------------------------------

PostgreSQL 的詳細介紹:請點這裡
PostgreSQL 的:請點這裡

本文永久更新連結地址:

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.