Skip to content

Instantly share code, notes, and snippets.

@hatena-iti
Last active August 29, 2015 13:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hatena-iti/9204349 to your computer and use it in GitHub Desktop.
Save hatena-iti/9204349 to your computer and use it in GitHub Desktop.
FROM centos
MAINTAINER hatena@iti.co.jp
ENV http_proxy http://proxy.example.com
ENV https_proxy http://proxy.example.com
RUN yum update -y
RUN yum install -y openssh-server httpd php php-mbstring mysql-server php-mysql python-setuptools
RUN yum clean all
RUN easy_install supervisor
# sshd
ADD id_rsa.pub /root/id_rsa.pub
RUN mkdir -p /root/.ssh/
RUN cp /root/id_rsa.pub /root/.ssh/authorized_keys
RUN chmod 700 /root/.ssh
RUN chmod 600 /root/.ssh/authorized_keys
RUN sed -i -e '/^UsePAM\s\+yes/d' /etc/ssh/sshd_config
RUN /etc/init.d/sshd start && /etc/init.d/sshd stop
# mysqld
RUN touch /etc/sysconfig/network
RUN /etc/init.d/mysqld start && mysqladmin -u root password 'your_password' && /etc/init.d/mysqld stop
#RUN /etc/init.d/mysqld start && mysqladmin -u root password 'your_password' && (echo 'grant all privileges on *.* to root@"%" identified by "your_password" with grant option;' | mysql -u root -pyour_password) && /etc/init.d/mysqld stop
# supervisord
RUN mkdir -p /var/log/supervisor
ADD supervisord.conf /etc/supervisord.conf
EXPOSE 22 80 3306
CMD ["/usr/bin/supervisord"]
[supervisord]
http_port=/var/tmp/supervisor.sock ; (default is to run a UNIX domain socket server)
;http_port=127.0.0.1:9001 ; (alternately, ip_address:port specifies AF_INET)
;sockchmod=0700 ; AF_UNIX socketmode (AF_INET ignore, default 0700)
;sockchown=nobody.nogroup ; AF_UNIX socket uid.gid owner (AF_INET ignores)
;umask=022 ; (process file creation umask;default 022)
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (logging level;default info; others: debug,warn)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=true ; (start in foreground if true;default false)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
minprocs=200 ; (min. avail process descriptors;default 200)
;nocleanup=true ; (don't clean up tempfiles at start;default false)
;http_username=user ; (default is no username (open system))
;http_password=123 ; (default is no password (open system))
;childlogdir=/tmp ; ('AUTO' child log dir, default $TEMP)
;user=chrism ; (default is current user, required if root)
;directory=/tmp ; (default is not to cd during start)
;environment=KEY=value ; (key value pairs to add to environment)
[supervisorctl]
serverurl=unix:///var/tmp/supervisor.sock ; use a unix:// URL for a unix socket
;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
;username=chris ; should be same as http_username if set
;password=123 ; should be same as http_password if set
;prompt=mysupervisor ; cmd line prompt (default "supervisor")
; The below sample program section shows all possible program subsection values,
; create one or more 'real' program: sections to be able to control them under
; supervisor.
[program:httpd]
command=/usr/sbin/httpd -D FOREGROUND
[program:sshd]
command=/usr/sbin/sshd -D
[program:mysqld]
command=/usr/bin/mysqld_safe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment