Last active
August 29, 2015 13:56
-
-
Save memorycraft/9175072 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# centosがベース | |
FROM centos | |
# 作成者 | |
MAINTAINER memorycraft | |
# yumでいろいろインストール | |
RUN rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm | |
RUN yum install sudo passwd openssh openssh-clients openssh-server vim python-setuptools nginx -y | |
# sshdの設定 | |
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config | |
RUN sed -ri 's/#UsePAM no/UsePAM no/g' /etc/ssh/sshd_config | |
# キーの生成 | |
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key | |
RUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key | |
# sshでログインするユーザーを用意 | |
RUN useradd tenkaippin | |
RUN echo 'tenkaippin:tenkaippin_password' | chpasswd | |
RUN echo 'tenkaippin ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/tenkaippin | |
# supervisordのインストール | |
RUN easy_install supervisor | |
# supervisordの設定 | |
RUN echo_supervisord_conf > /etc/supervisord.conf | |
RUN echo '[include]' >> /etc/supervisord.conf | |
RUN echo 'files = supervisord/conf/*.conf' >> /etc/supervisord.conf | |
RUN mkdir -p /etc/supervisord/conf/ | |
ADD supervisor.conf /etc/supervisord/conf/service.conf | |
# ポート開放 | |
EXPOSE 22 80 | |
# 起動時にsupervisordを実行 | |
CMD ["/usr/bin/supervisord"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment