Skip to content

Instantly share code, notes, and snippets.

@timhughes
Last active December 31, 2015 19:08
Show Gist options
  • Save timhughes/8031228 to your computer and use it in GitHub Desktop.
Save timhughes/8031228 to your computer and use it in GitHub Desktop.
Docker file for creating a http server which is managed by supervisord
# HTTP server
#
# Need to get the supervisord xmlrpc server listening on 9001 so that we can control it remotely
#
# Create and run::
#
# docker build -t timhughes/webserver - < httpd.docker
# docker run -t timhughes/webserver
#
# Base stuff for supervisor
FROM centos
MAINTAINER Tim Hughes <thughes@thegoldfish.org>
RUN yum -y --nogpgcheck localinstall http://mirror.bytemark.co.uk/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
RUN yum -y update
RUN yum install -y supervisor
RUN mkdir -p /var/log/supervisor
RUN sed -i 's/^nodaemon=false/nodaemon=true/' /etc/supervisord.conf
#
RUN yum -y install openssh-server
RUN printf "\n[program:sshd]\ncommand=/usr/sbin/sshd -D\n" >> /etc/supervisord.conf
RUN yum -y install httpd
RUN printf "\n[program:httpd]\ncommand=/usr/sbin/httpd -DFOREGROUND\n" >> /etc/supervisord.conf
RUN hostname -I
EXPOSE 22 80 9001
CMD hostname -I && supervisord
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment