diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..725af0f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,97 @@ +################################################################################ +# Dockerfile de construcao do container APP com os pacotes basicos +################################################################################ + +FROM alpine:3.19 + +RUN apk add --no-cache \ + apache2 \ + apache2-http2 \ + gnu-libiconv \ + php82-apache2 \ + php82-bcmath \ + php82-bz2 \ + php82-calendar \ + php82-ctype \ + php82-curl \ + php82-dom \ + php82-exif \ + php82-fileinfo \ + php82-gd \ + php82-gettext \ + php82-gmp \ + php82-iconv \ + php82-imap \ + php82-intl \ + php82-ldap \ + php82-mbstring \ + php82-mysqli \ + php82-odbc \ + php82-openssl \ + php82-pcntl \ + php82-pdo \ + php82-pear \ + php82-pecl-apcu \ + php82-pecl-igbinary \ + php82-pecl-mcrypt \ + php82-pecl-memcache \ + php82-pecl-xdebug \ + php82-pgsql \ + php82-phar \ + php82-pspell \ + php82-simplexml \ + php82-sodium \ + php82-shmop \ + php82-snmp \ + php82-soap \ + php82-xml \ + php82-zip \ + php82-zlib \ + php82-pecl-uploadprogress; + +# Pacotes para o wkhtmltopdf +RUN apk add --no-cache \ + libstdc++ \ + libx11 \ + libxrender \ + libxext \ + libssl3 \ + ca-certificates \ + fontconfig \ + freetype \ + ttf-dejavu \ + ttf-droid \ + ttf-freefont \ + ttf-liberation \ + # more fonts + && apk add --no-cache --virtual .build-deps \ + msttcorefonts-installer \ + # Install microsoft fonts + && update-ms-fonts \ + && fc-cache -f \ + # Clean up when done + && rm -rf /tmp/* \ + && apk del .build-deps + +# wkhtmltopdf # +COPY --from=surnet/alpine-wkhtmltopdf:3.19.1-0.12.6-small \ + /bin/wkhtmltopdf /bin/wkhtmltopdf + +RUN apk add --no-cache openjdk8 + +COPY assets/sei.ini /etc/php82/conf.d/99_sei.ini +COPY assets/xdebug.ini /etc/php82/conf.d/99_xdebug.ini +COPY assets/sei.conf /etc/apache2/conf.d/ +COPY assets/cron.conf /tmp/cron.conf +RUN cat /tmp/cron.conf >> /etc/crontabs/root + +# Pasta para arquivos externos +RUN mkdir -p /var/sei/arquivos && chown -R apache.apache /var/sei/arquivos && chown 777 /tmp + +RUN mkdir -p /var/log/sei && mkdir -p /var/log/sip +# Suporte para atualização do SEI. O script de atualização do SEI está fixo no bash +RUN apk add --no-cache \ + bash curl; + +EXPOSE 80 +CMD ["sh", "-c", "crond && httpd -DFOREGROUND"] diff --git a/assets/cron.conf b/assets/cron.conf new file mode 100644 index 0000000..526af62 --- /dev/null +++ b/assets/cron.conf @@ -0,0 +1,2 @@ +* * * * * /usr/bin/php /opt/sei/scripts/AgendamentoTarefaSEI.php 2>&1 >> /var/log/sei/agendamento_sei.log +* * * * * /usr/bin/php /opt/sip/scripts/AgendamentoTarefaSip.php 2>&1 >> /var/log/sip/agendamento_sip.log diff --git a/assets/pdo_client_info.php b/assets/pdo_client_info.php new file mode 100644 index 0000000..0b1edff --- /dev/null +++ b/assets/pdo_client_info.php @@ -0,0 +1,57 @@ + "sei", + "uid" => "sei_user", + "pwd" => "sei_user" +); + +function exception_handler($exception) { + echo "

Failure

"; + echo "Uncaught exception: " , $exception->getMessage(); + echo "

PHP Info for troubleshooting

"; + phpinfo(); +} + +set_exception_handler('exception_handler'); + +// Establishes the connection +$conn = sqlsrv_connect($serverName, $connectionOptions); +if ($conn === false) { + die(formatErrors(sqlsrv_errors())); +} + +// Select Query +$tsql = "SELECT @@Version AS SQL_VERSION"; + +// Executes the query +$stmt = sqlsrv_query($conn, $tsql); + +// Error handling +if ($stmt === false) { + die(formatErrors(sqlsrv_errors())); +} +?> + +

Success Results :

+ +SQL Error:"; + echo "Error information:
"; + foreach ($errors as $error) { + echo "SQLSTATE: ". $error['SQLSTATE'] . "
"; + echo "Code: ". $error['code'] . "
"; + echo "Message: ". $error['message'] . "
"; + } +} +?> diff --git a/assets/sei.conf b/assets/sei.conf new file mode 100644 index 0000000..3870a8f --- /dev/null +++ b/assets/sei.conf @@ -0,0 +1,41 @@ +Listen 8000 +KeepAlive On +MaxKeepAliveRequests 100 +KeepAliveTimeout 15 + +Alias "/sei" "/opt/sei/web" +Alias "/sip" "/opt/sip/web" +Alias "/infra_css" "/opt/infra/infra_css" +Alias "/infra_js" "/opt/infra/infra_js" + +SetEnvIfNoCase user-agent "Microsoft Data Access Internet Publishing Provider Protocol Discovery" bad_bot=1 + + Order Allow,Deny + Allow from all + Deny from env=bad_bot + + + + DocumentRoot /var/www/html + ServerAdmin admin@dominio.gov.br + ServerName localhost + + DirectoryIndex index.php index.html + IndexIgnore * + EnableSendfile Off + HostnameLookups Off + ServerSignature Off + AddDefaultCharset iso-8859-1 + + + AllowOverride None + Require all denied + + + + AllowOverride None + Options None + Require all granted + + + \ No newline at end of file diff --git a/assets/sei.ini b/assets/sei.ini new file mode 100644 index 0000000..3cc8798 --- /dev/null +++ b/assets/sei.ini @@ -0,0 +1,20 @@ +[php] +; Parâmetros recomendados no Manual de Instalação +include_path = ".:/php/includes:/opt/infra/infra_php" +default_charset = "iso-8859-1" +session.gc_maxlifetime = 28800 +short_open_tag = On +default_socket_timeout = 60 +max_input_vars = 2000 +magic-quotes-gpc = 0 +magic_quotes_runtime = 0 +magic_quotes_sybase = 0 +post_max_size = 110M +upload_max_filesize = 100M + +; Parâmetros recomendados para ambiente de desenvolvimento +error_reporting = E_ALL +display_errors = On +display_startup_errors = On +html_errors = On +always_populate_raw_post_data = -1 \ No newline at end of file diff --git a/assets/xdebug.ini b/assets/xdebug.ini new file mode 100644 index 0000000..9f38f95 --- /dev/null +++ b/assets/xdebug.ini @@ -0,0 +1,7 @@ +zend_extension=xdebug.so +xdebug.mode=debug +xdebug.client_host=localhost +xdebug.client_port=9003 +xdebug.remote_handler=dbgp +xdebug.discover_client_host=1 +xdebug.idekey=default \ No newline at end of file