diff --git a/Dockerfile b/Dockerfile index c79a0f0..7af3508 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,10 +3,12 @@ EXPOSE 80 139 445 WORKDIR / COPY Service-check.sh . RUN apt-get update && apt-get upgrade -y -RUN apt-get install apt-transport-https wget samba samba-common -y && \ -mkdir /media/storage /data && \ -chmod 0777 /media/storage /data /data/samba /data/webmin && \ -ln -s /etc/samba /data && ln -s /etc/webmin /data +RUN apt-get install apt-transport-https wget samba samba-common unison -y && \ +mkdir /media/storage /data /data/samba /data/webmin + +VOLUME /data + +RUN chmod -R 0777 /media/storage /data RUN echo "deb https://download.webmin.com/download/repository sarge contrib" >> /etc/apt/sources.list && \ cd /root && \ @@ -24,5 +26,4 @@ RUN sed -i 's/10000/80/g' /etc/webmin/miniserv.conf && \ sed -i 's/ssl=1/ssl=0/g' /etc/webmin/miniserv.conf RUN echo root:webmin | chpasswd -VOLUME /data CMD [ "/bin/bash","/Service-check.sh" ] diff --git a/Service-check.sh b/Service-check.sh index a6b1e20..32b3a7e 100644 --- a/Service-check.sh +++ b/Service-check.sh @@ -1,11 +1,11 @@ #!/bin/bash +unison -batch /etc/samba /data/samba +unison -batch /etc/webmin /data/webmin apt-get update && apt-get upgrade -y wait service webmin start service smbd start service nmbd start -ln -s /data/samba /etc/samba -ln -s /data/webmin /etc/webmin while true do if [[ $(service webmin status) = *stopped* ]]