FROM centos

VOLUME /configuration

VOLUME [ "/sys/fs/cgroup" ]

VOLUME ["/run/dbus/system_bus_socket:/run/dbus/system_bus_socket"]

RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/.wants/;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/udev; \
rm -f /lib/systemd/system/sockets.target.wants/initctl; \
rm -f /lib/systemd/system/basic.target.wants/*;\
rm -f /lib/systemd/system/anaconda.target.wants/*;

RUN yum clean all && \
    yum -y update && \
    yum -y install httpd && \
    systemctl enable httpd.service && \
    yum -y install wget && \
    yum -y install dbus-x11 && \
    yum -y install sudo && \
    systemctl disable kdump.service

VOLUME /run /tmp

EXPOSE 27017 27018 27019 9216

ENV DBUS_SYSTEM_BUS_ADDRESS=unix:path=/var/run/dbus/system_bus_socket

ENTRYPOINT ["/configuration/mongo.sh"]

