diff --git a/Dockerfile b/Dockerfile index 48f8555..c81cb18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -68,9 +68,9 @@ ENV COMPOSER_ALLOW_SUPERUSER=1 RUN composer install RUN service php8.3-fpm start -#COPY entrypoint.sh /entrypoint.sh -# -#ENTRYPOINT [ "/entrypoint.sh" ] +COPY entrypoint.sh /entrypoint.sh + +ENTRYPOINT [ "/entrypoint.sh" ] CMD ["php-fpm8.3", "-F"] EXPOSE 9000 \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index d2ff61d..b56eb29 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,12 +1,14 @@ -#!/bin/bash -x +#!/bin/bash -x -if [[ $APP_ENV == "prod"]];then +APP_ENV=$(grep APP_ENV $DIRECTORY".env.local" | xargs) + +if [[ ${APP_ENV#*=} == "prod" ]]; then service pcscd start cert=$(/opt/cprocsp/bin/amd64/csptest -keyset -enum_cont -verifyc -fq | grep Aktiv | awk -F'00 00' '{print $2}' | tr -d '\\') /opt/cprocsp/bin/amd64/certmgr -inst -cont "${cert}" -store uMy certmgr -list -store umy SHA=$(certmgr -list -store umy | grep SHA | awk -F':' '{print $2}' | tr -d ' ') -fi +fi # pdfcpro sign /mnt/t/123.pdf -out /mnt/t/123_sign.pdf -cert ${SHA} -text "\n\t\tПодписано ЭП\n\t\t{subject/cn}\n\t\tСертификат {sha1}\n\t\tДействителен от {since} до {until}\n\t\tДата {date}\n\t\t{subject/t}\n\t\t{subject/fullname}\n\t\t" -fontfile /usr/local/share/fonts/Inter-Bold.ttf -fontsize 8 -x 2 -y 2 -w 96 -h 9