Владимир Томишинец преди 5 години
родител
ревизия
d49dd9999b
променени са 2 файла, в които са добавени 8 реда и са изтрити 14 реда
  1. 2 2
      Dockerfile
  2. 6 12
      entrypoint.sh

+ 2 - 2
Dockerfile

@@ -21,12 +21,12 @@ RUN mkdir -p /etc/acme-dns && mkdir -p /var/lib/acme-dns && mkdir /etc/letsencry
     && apk --no-cache add curl sqlite bash git openssh-client \
         openssl openssl-dev python3 python3-dev musl-dev sqlite gcc libffi-dev \
     && pip3 install certbot \
+    && ln -sf /usr/bin/python3 /usr/bin/python \
     && curl -o /etc/letsencrypt/acme-dns-auth.py \
 	https://raw.githubusercontent.com/joohoi/acme-dns-certbot-joohoi/master/acme-dns-auth.py \
     && chmod 0700 /etc/letsencrypt/acme-dns-auth.py
 
-#VOLUME ["/etc/acme-dns", "/var/lib/acme-dns"]
 ENTRYPOINT ["/entrypoint.sh"]
 EXPOSE 53
 EXPOSE 53/udp
-CMD ["./acme-dns", "-c", "/pki/iru/wild/acme-dns/infoclinica.ru.config.cfg"]
+

+ 6 - 12
entrypoint.sh

@@ -1,24 +1,18 @@
 #!/bin/bash
 
-#Убиваем все что осталось с прошлого раза
-[ -d /pki ] && rm -rf /pki
-#[ -f /var/lib/acme-dns/acme-dns.db ] && rm -f /var/lib/acme-dns/acme-dns.db
 echo "$SSHKEY" > /tmp/keyfile
 chmod 0400 /tmp/keyfile
 
 GIT_SSH_COMMAND='ssh -i /tmp/keyfile -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' git clone ${git_url}
 
-if [ $? != '0' ]
+if [ $? == '0' ]
 then
-    echo "Cannot git clone the ${git_url}"; exit 1
-# Производим рестор БД    
-#    zcat /pki/iru/wild/infoclinica.ru.dump.gz | sqlite3 /var/lib/acme-dns/acme-dns.db
-#    chmod 0600 /var/lib/acme-dns/acme-dns.db
-# Подкидываем конфигурационные файлы
-#    cp /pki/iru/wild/acme-dns/infoclinica.ru.config.cfg /etc/acme-dns/config.cfg
-else
     echo "git clone the ${git_url} done"
-    echo "Starting ACME-DNS"
+    echo "All tasks complete!!!"
+    echo "Attention! Before generate or renew certificates manual"
+    echo "Please read https://git.sdsys.ru/sdsys/pki/src/master/iru/wild/acme-dns/README.md"
+else
+    echo "Cannot git clone the ${git_url}"; exit 1
 fi
 
 exec "$@"