diff --git a/containers/app/app-dev/alpine/Dockerfile b/containers/app/app-dev/alpine/Dockerfile new file mode 100644 index 0000000..8cc25e8 --- /dev/null +++ b/containers/app/app-dev/alpine/Dockerfile @@ -0,0 +1,72 @@ +################################################################################ +# Dockerfile de construcao do container APP com os pacotes basicos +################################################################################ + +FROM alpine:3.13 + +RUN apk add --no-cache \ + apache2 \ + apache2-http2 \ + php7-apache2 \ + php7-bcmath \ + php7-calendar \ + php7-ctype \ + php7-curl \ + php7-dom \ + php7-fileinfo \ + php7-gd \ + php7-gettext \ + php7-gmp \ + php7-imap \ + php7-intl \ + php7-ldap \ + php7-mbstring \ + php7-mcrypt \ + php7-mysqli \ + php7-odbc \ + php7-pcntl \ + php7-pdo \ + php7-pear \ + php7-pecl-apcu \ + php7-pecl-mcrypt \ + php7-pecl-memcache \ + php7-pecl-xdebug \ + php7-pspell \ + php7-shmop \ + php7-snmp \ + php7-soap \ + php7-xml \ + php7-xmlrpc \ + php7-zip \ + php7-zlib \ + ; + +# Utiliza versão 1.1.4 pois há uma segmentation fault no 1.1.3 +RUN apk add --no-cache \ + --repository=https://dl-cdn.alpinelinux.org/alpine/v3.14/community/ \ + php7-pecl-uploadprogress; + +# Pacotes para o wkhtmltopdf +RUN apk add --no-cache \ + libgcc libstdc++ libx11 glib libxrender libxext libintl \ + ttf-dejavu ttf-droid ttf-freefont ttf-liberation + +# wkhtmltopdf # +COPY --from=madnight/docker-alpine-wkhtmltopdf:0.12.5-alpine3.13 \ + /bin/wkhtmltopdf /bin/wkhtmltopdf + +RUN apk add --no-cache openjdk8 + +COPY assets/sei.ini /etc/php7/conf.d/99_sei.ini +COPY assets/xdebug.ini /etc/php7/conf.d/99_xdebug.ini +COPY assets/sei.conf /etc/apache2/conf.d/ + +# Pasta para arquivos externos +RUN mkdir -p /var/sei/arquivos && chown apache.apache /var/sei/arquivos + +# Suporte para atualização do SEI. O script de atualização do SEI está fixo no bash +RUN apk add --no-cache \ + bash; + +EXPOSE 80 +CMD ["httpd", "-DFOREGROUND"] diff --git a/containers/app/app-dev/alpine/Dockerfile-php8 b/containers/app/app-dev/alpine/Dockerfile-php8 new file mode 100644 index 0000000..6d41814 --- /dev/null +++ b/containers/app/app-dev/alpine/Dockerfile-php8 @@ -0,0 +1,96 @@ +################################################################################ +# 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-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/containers/app/app-dev/alpine/Dockerfile-sqlserver b/containers/app/app-dev/alpine/Dockerfile-sqlserver new file mode 100644 index 0000000..9c0c276 --- /dev/null +++ b/containers/app/app-dev/alpine/Dockerfile-sqlserver @@ -0,0 +1,75 @@ +################################################################################ +# Dockerfile de construcao do container APP com os pacotes basicos +################################################################################ + +FROM alpine:3.12 + +RUN apk add --no-cache \ + apache2 \ + apache2-http2 \ + php7-apache2 \ + php7-bcmath \ + php7-calendar \ + php7-ctype \ + php7-curl \ + php7-dom \ + php7-gd \ + php7-gettext \ + php7-gmp \ + php7-imap \ + php7-intl \ + php7-ldap \ + php7-mbstring \ + php7-mcrypt \ + php7-mysqli \ + php7-odbc \ + php7-pcntl \ + php7-pdo \ + php7-pear \ + php7-pecl-apcu \ + php7-pecl-mcrypt \ + php7-pecl-memcache \ + php7-pecl-memcached \ + php7-pecl-uploadprogress \ + php7-pspell \ + php7-shmop \ + php7-snmp \ + php7-soap \ + php7-xml \ + php7-xmlrpc \ + php7-zip \ + php7-zlib \ + ; + +# Pacotes para o wkhtmltopdf +RUN apk add --update --no-cache \ + libgcc libstdc++ libx11 glib libxrender libxext libintl \ + ttf-dejavu ttf-droid ttf-freefont ttf-liberation ttf-ubuntu-font-family + +# wkhtmltopdf # +COPY --from=madnight/alpine-wkhtmltopdf-builder:0.12.5-alpine3.10-866998106 \ + /bin/wkhtmltopdf /bin/wkhtmltopdf + +COPY assets/sei.ini /etc/php7/conf.d/ +COPY assets/sei.conf /etc/apache2/conf.d/ + +RUN apk add --no-cache openjdk8 + +RUN apk add curl && \ + curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.6.1.1-1_amd64.apk && \ + curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_17.6.1.1-1_amd64.apk && \ + apk add --allow-untrusted msodbcsql17_17.6.1.1-1_amd64.apk && \ + apk add --allow-untrusted mssql-tools_17.6.1.1-1_amd64.apk && \ + ln -sfnv /opt/mssql-tools/bin/* /usr/bin && \ + PECL_DEPS='unixodbc-dev php7-dev m4 perl autoconf dpkg dpkg-dev libmagic file binutils isl libgomp libatomic libgphobos mpfr4 mpc1 gcc musl-dev libc-dev g++ make re2c' && \ + apk add --no-cache $PECL_DEPS && \ + pecl install sqlsrv && \ + pecl install pdo_sqlsrv && \ + apk del $PECL_DEPS curl + +RUN echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/10_pdo_sqlsrv.ini + +RUN echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20_sqlsrv.ini + +EXPOSE 80 +CMD ["httpd", "-DFOREGROUND"] diff --git a/containers/app/app-dev/alpine/assets/cron.conf b/containers/app/app-dev/alpine/assets/cron.conf new file mode 100644 index 0000000..526af62 --- /dev/null +++ b/containers/app/app-dev/alpine/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/containers/app/app-dev/alpine/assets/sei.conf b/containers/app/app-dev/alpine/assets/sei.conf new file mode 100644 index 0000000..3870a8f --- /dev/null +++ b/containers/app/app-dev/alpine/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/containers/app/app-dev/alpine/assets/sei.ini b/containers/app/app-dev/alpine/assets/sei.ini new file mode 100644 index 0000000..3cc8798 --- /dev/null +++ b/containers/app/app-dev/alpine/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/containers/app/app-dev/alpine/assets/xdebug.ini b/containers/app/app-dev/alpine/assets/xdebug.ini new file mode 100644 index 0000000..9f38f95 --- /dev/null +++ b/containers/app/app-dev/alpine/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 diff --git a/containers/databases/mariadb/Dockerfile-4.1 b/containers/databases/mariadb/Dockerfile-4.1 new file mode 100644 index 0000000..2f38f6f --- /dev/null +++ b/containers/databases/mariadb/Dockerfile-4.1 @@ -0,0 +1,34 @@ +################################################################################ +# Dockerfile de construção do container Mariadb utilizado pelo SUPER +# construa antes a imagem base +################################################################################ + +ARG IMAGEM_BASE=supergovbr/base-mariadb10.5:latest + +FROM ${IMAGEM_BASE} as builder + +ARG GIT_DB_REF=https://github.com/spbgovbr/sei-db-ref-executivo/raw/master + +############################# INÍCIO DA INSTALAÇÃO ############################# +ENV MYSQL_ROOT_PASSWORD=P@ssword + +COPY assets/my.cnf /etc/mysql/mariadb.conf.d/sei.cnf +COPY assets/pre-install.sql /docker-entrypoint-initdb.d/1_pre-install.sql +ADD ${GIT_DB_REF}/mysql/v4.1.0/sei_4_1_0_BD_Ref_Exec.sql /docker-entrypoint-initdb.d/2_sei_4_1_0_BD_Ref_Exec.sql +ADD ${GIT_DB_REF}/mysql/v4.1.0/sip_4_1_0_BD_Ref_Exec.sql /docker-entrypoint-initdb.d/3_sip_4_1_0_BD_Ref_Exec.sql +COPY assets/pos-install.sql /docker-entrypoint-initdb.d/9_pos-install.sql + +RUN chmod 644 /etc/mysql/mariadb.conf.d/sei.cnf +RUN chmod +r /docker-entrypoint-initdb.d/2_sei_4_1_0_BD_Ref_Exec.sql +RUN chmod +r /docker-entrypoint-initdb.d/3_sip_4_1_0_BD_Ref_Exec.sql +RUN sed -i '1i use sei; \n' /docker-entrypoint-initdb.d/2_sei_4_1_0_BD_Ref_Exec.sql +RUN sed -i '1i use sip; \n' /docker-entrypoint-initdb.d/3_sip_4_1_0_BD_Ref_Exec.sql + +RUN ["sed", "-i", "s/exec \"$@\"/echo \"not running $@\"/", "/usr/local/bin/docker-entrypoint.sh"] +RUN ["/usr/local/bin/docker-entrypoint.sh", "mysqld", "--datadir", "/initialized-db"] + + +############################## FIM DA INSTALAÇÃO ########################### +FROM ${IMAGEM_BASE} +COPY --from=builder /initialized-db /var/lib/mysql +COPY --from=builder /etc/mysql/mariadb.conf.d/sei.cnf /etc/mysql/mariadb.conf.d/sei.cnf