Commit c07ed7a08462c53b7e2cdbcfc25bf42a50f33be0
1 parent
35d0e2ec
Exists in
sei-v3.0.0-oracle-dockerimages
and in
3 other branches
issue#1 - Correção de erro 'Forbidden' na inicialização dos serviço
Showing
8 changed files
with
24 additions
and
33 deletions
Show diff stats
Vagrantfile
| ... | ... | @@ -24,7 +24,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
| 24 | 24 | # Every Vagrant virtual environment requires a box to build off of. |
| 25 | 25 | # config.vm.box_download_checksum = "76a2a61de2d89f6cfd4d795e57cc4406" |
| 26 | 26 | # config.vm.box_download_checksum_type = "md5" |
| 27 | - config.vm.box = "processoeletronico/centos-6.6" | |
| 27 | + config.vm.box = "minimum/centos-7-docker" | |
| 28 | + #config.vm.box = "centos/7" | |
| 28 | 29 | |
| 29 | 30 | # Disable automatic box update checking. If you disable this, then |
| 30 | 31 | # boxes will only be checked for updates when the user runs |
| ... | ... | @@ -41,7 +42,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
| 41 | 42 | # Diretórios compartilhados com a durante a execução |
| 42 | 43 | config.vm.synced_folder ".", "/mnt/sei/ops" |
| 43 | 44 | config.vm.synced_folder params_source_dir, "/mnt/sei/src", mount_options: ["dmode=777", "fmode=777"] |
| 44 | - #config.vm.synced_folder params_repo_arquivos, "/mnt/sei/arquivos", create: true, mount_options: ["dmode=777", "fmode=777"] | |
| 45 | 45 | config.vm.synced_folder File.dirname(params_script_sei), "/mnt/sei/db_sei" |
| 46 | 46 | config.vm.synced_folder File.dirname(params_script_sip), "/mnt/sei/db_sip" |
| 47 | 47 | |
| ... | ... | @@ -104,5 +104,6 @@ SCRIPT |
| 104 | 104 | config.vm.provision "shell", inline: "rm -rf /mnt/sei/ops/mysql/.tmp" |
| 105 | 105 | |
| 106 | 106 | # Inicialização dos containers em caso de reinicialização da máquina host |
| 107 | - config.vm.provision "shell", run: "always", inline: "docker start sei_db sei_solr sei_jod sei_www" | |
| 107 | + # A inicialização é realizada de forma sequencial para evitar conflito no mapeamento de volumes no Docker | |
| 108 | + config.vm.provision "shell", run: "always", inline: "docker restart sei_solr && docker restart sei_jod && docker restart sei_db && docker restart sei_www" | |
| 108 | 109 | end | ... | ... |
jod/Dockerfile
| ... | ... | @@ -20,7 +20,6 @@ RUN yum -y update && \ |
| 20 | 20 | yum install -y java-1.7.0-openjdk-devel wget unzip dos2unix libreoffice libreoffice-headless && \ |
| 21 | 21 | yum -y clean all |
| 22 | 22 | |
| 23 | -# TODO: Utilizar wget para obter o pacote da web, removendo-o posteriormente para otimizar o tamanho da imagem | |
| 24 | 23 | # Instalação da api de serviços de conversão de documentos |
| 25 | 24 | ADD jodconverter-tomcat-2.2.2.zip /opt/ |
| 26 | 25 | RUN unzip /opt/jodconverter-tomcat-2.2.2.zip -d /opt && rm /opt/jodconverter-tomcat-2.2.2.zip | ... | ... |
jod/entrypoint.sh
| ... | ... | @@ -7,4 +7,4 @@ echo "Iniciando o serviço LibreOffice headless ..." |
| 7 | 7 | $SOFFICE_PATH --headless --nologo --nofirststartwizard --accept="socket,host=127.0.0.1,port=8100;urp" & > /dev/null 2>&1 |
| 8 | 8 | |
| 9 | 9 | echo "Iniciando o serviço Tomcat 6 ..." |
| 10 | -$TOMCAT6_PATH run | |
| 11 | 10 | \ No newline at end of file |
| 11 | +$TOMCAT6_PATH run | ... | ... |
mysql/Dockerfile
| ... | ... | @@ -28,40 +28,40 @@ ADD .tmp/sip_mysql.sql /tmp/sip_mysql.sql |
| 28 | 28 | RUN mysql_install_db |
| 29 | 29 | |
| 30 | 30 | # Criação dos bancos de dados do sistema |
| 31 | -RUN service mysqld start && \ | |
| 31 | +RUN /etc/init.d/mysqld start && \ | |
| 32 | 32 | mysqladmin create sip && \ |
| 33 | 33 | mysqladmin create sei |
| 34 | 34 | |
| 35 | 35 | # Criação dos usuários utilizados na conexão com SEI e SIP |
| 36 | -RUN service mysqld start && \ | |
| 36 | +RUN /etc/init.d/mysqld start && \ | |
| 37 | 37 | mysql -e "CREATE USER 'sip_user'@'%' IDENTIFIED BY 'sip_user'" sip && \ |
| 38 | 38 | mysql -e "CREATE USER 'sei_user'@'%' IDENTIFIED BY 'sei_user'" sei && \ |
| 39 | 39 | mysql -e "GRANT ALL PRIVILEGES ON sip.* TO 'sip_user'@'%'" sip && \ |
| 40 | 40 | mysql -e "GRANT ALL PRIVILEGES ON sei.* TO 'sei_user'@'%'" sei |
| 41 | 41 | |
| 42 | 42 | # Restauração dos bancos de dados |
| 43 | -RUN service mysqld start && cd /tmp && \ | |
| 43 | +RUN /etc/init.d/mysqld start && cd /tmp && \ | |
| 44 | 44 | mysql sei < sei_mysql.sql && \ |
| 45 | 45 | mysql sip < sip_mysql.sql && \ |
| 46 | 46 | rm -f /tmp/sei_mysql.sql /tmp/sip_mysql.sql |
| 47 | 47 | |
| 48 | 48 | # Atualização dos parâmetros do SEI e do SIP |
| 49 | -RUN service mysqld start && \ | |
| 49 | +RUN /etc/init.d/mysqld start && \ | |
| 50 | 50 | mysql -e "update orgao set sigla='ABC', descricao='ORGAO ABC' where id_orgao=0;" sip && \ |
| 51 | 51 | mysql -e "update sistema set pagina_inicial='http://localhost/sip' where sigla='SIP';" sip && \ |
| 52 | 52 | mysql -e "update sistema set pagina_inicial='http://localhost/sei/inicializar.php', web_service='http://localhost/sei/controlador_ws.php?servico=sip' where sigla='SEI';" sip && \ |
| 53 | 53 | mysql -e "update orgao set sigla='ABC', descricao='ORGAO ABC' where id_orgao=0;" sei |
| 54 | 54 | |
| 55 | 55 | # Temp: Remove registros de auditoria presentes na base de referência |
| 56 | -RUN service mysqld start && \ | |
| 56 | +RUN /etc/init.d/mysqld start && \ | |
| 57 | 57 | mysql -e "delete from auditoria_protocolo;" sei |
| 58 | 58 | |
| 59 | 59 | # Configuração para utilizar autenticação nativa do SEI/SIP |
| 60 | -RUN service mysqld start && \ | |
| 60 | +RUN /etc/init.d/mysqld start && \ | |
| 61 | 61 | mysql -e "update orgao set sin_autenticar='N' where id_orgao=0;" sip |
| 62 | 62 | |
| 63 | 63 | # Atribuição de permissões de acesso externo para o usuário root, senha root |
| 64 | -RUN service mysqld start && \ | |
| 64 | +RUN /etc/init.d/mysqld start && \ | |
| 65 | 65 | mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;" |
| 66 | 66 | |
| 67 | 67 | ##################### FIM DA INSTALACAO ##################### | ... | ... |
sei/ConfiguracaoSEI.php
| ... | ... | @@ -33,11 +33,7 @@ class ConfiguracaoSEI extends InfraConfiguracao { |
| 33 | 33 | |
| 34 | 34 | 'PaginaSEI' => array( |
| 35 | 35 | 'NomeSistema' => 'SEI', |
| 36 | -<<<<<<< HEAD | |
| 37 | 36 | 'NomeSistemaComplemento' => SEI_VERSAO, |
| 38 | -======= | |
| 39 | - 'NomeSistemaComplemento' => 'Localhost', | |
| 40 | ->>>>>>> c799bdce223d03a069cd8c6b84606ecd4db6a70c | |
| 41 | 37 | 'LogoMenu' => ''), |
| 42 | 38 | |
| 43 | 39 | 'SessaoSEI' => array( | ... | ... |
sei/ConfiguracaoSip.php
| ... | ... | @@ -24,11 +24,7 @@ class ConfiguracaoSip extends InfraConfiguracao { |
| 24 | 24 | |
| 25 | 25 | 'PaginaSip' => array( |
| 26 | 26 | 'NomeSistema' => 'SIP', |
| 27 | -<<<<<<< HEAD | |
| 28 | 27 | 'NomeSistemaComplemento' => SIP_VERSAO), |
| 29 | -======= | |
| 30 | - 'NomeSistemaComplemento' => 'Localhost'), | |
| 31 | ->>>>>>> c799bdce223d03a069cd8c6b84606ecd4db6a70c | |
| 32 | 28 | |
| 33 | 29 | 'SessaoSip' => array( |
| 34 | 30 | 'SiglaOrgaoSistema' => 'ABC', | ... | ... |
sei/entrypoint.sh
| ... | ... | @@ -3,20 +3,20 @@ |
| 3 | 3 | echo "127.0.0.1 sip_www" | tee -a /etc/hosts |
| 4 | 4 | |
| 5 | 5 | # Configura localização das aplicações SEI e SIP |
| 6 | -ln -s /mnt/sei/src/sei /var/www/html/sei | |
| 7 | -ln -s /mnt/sei/src/sip /var/www/html/sip | |
| 6 | +ln -s /mnt/sei/src/sei /var/www/html/ | |
| 7 | +ln -s /mnt/sei/src/sip /var/www/html/ | |
| 8 | 8 | |
| 9 | 9 | # Configura localização correta da infra_php |
| 10 | 10 | if [ -d /mnt/sei/src/infra/infra_php ]; then dir_infra_php="/mnt/sei/src/infra/infra_php"; else dir_infra_php="/mnt/sei/src/infra_php"; fi |
| 11 | -ln -sf $dir_infra_php /var/www/html/infra_php | |
| 11 | +ln -sf $dir_infra_php /var/www/html/ | |
| 12 | 12 | |
| 13 | 13 | # Configura localização correta da infra_js |
| 14 | 14 | if [ -d /mnt/sei/src/infra/infra_js ]; then dir_infra_js="/mnt/sei/src/infra/infra_js"; else dir_infra_js="/mnt/sei/src/infra_js"; fi |
| 15 | -ln -sf $dir_infra_js /var/www/html/infra_js | |
| 15 | +ln -sf $dir_infra_js /var/www/html/ | |
| 16 | 16 | |
| 17 | 17 | # Configura localização correta da infra_css |
| 18 | 18 | if [ -d /mnt/sei/src/infra/infra_css ]; then dir_infra_css="/mnt/sei/src/infra/infra_css"; else dir_infra_css="/mnt/sei/src/infra_css"; fi |
| 19 | -ln -sf $dir_infra_css /var/www/html/infra_css | |
| 19 | +ln -sf $dir_infra_css /var/www/html/ | |
| 20 | 20 | |
| 21 | 21 | # Atribuição dos parâmetros de configuração do SEI |
| 22 | 22 | if [ -f /var/www/html/sei/ConfiguracaoSEI.php ] && [ ! -f /var/www/html/sei/ConfiguracaoSEI.php~ ]; then |
| ... | ... | @@ -58,11 +58,11 @@ mkdir /var/www/html/sip/upload && chmod -R 666 /var/www/html/sip/upload |
| 58 | 58 | chmod +x /var/www/html/sei/ferramentas/wkhtmltopdf-amd64 |
| 59 | 59 | |
| 60 | 60 | # Inicialização do serviço de cache |
| 61 | -service memcached start | |
| 61 | +/etc/init.d/memcached start | |
| 62 | 62 | |
| 63 | 63 | # Inicialização das rotinas de agendamento |
| 64 | -service rsyslog start | |
| 65 | -service crond start | |
| 64 | +/etc/init.d/rsyslog start | |
| 65 | +/etc/init.d/crond start | |
| 66 | 66 | |
| 67 | 67 | # Inicialização do servidor web |
| 68 | 68 | /usr/sbin/httpd -DFOREGROUND | ... | ... |
solr/Dockerfile
| ... | ... | @@ -23,7 +23,6 @@ RUN yum update -y && \ |
| 23 | 23 | # Criação de usuário de execução do serviço |
| 24 | 24 | RUN useradd solr |
| 25 | 25 | |
| 26 | -# TODO: Utilizar wget para obter o pacote da web, removendo-o posteriormente para otimizar o tamanho da imagem | |
| 27 | 26 | # Obtenção do pacote de instalação do Solr 4.0 |
| 28 | 27 | ADD apache-solr-4.0.0.tgz /opt/ |
| 29 | 28 | |
| ... | ... | @@ -91,19 +90,19 @@ RUN mkdir /var/log/solr |
| 91 | 90 | RUN chown solr:solr -R /opt/solr /var/opt/sei /var/log/solr |
| 92 | 91 | |
| 93 | 92 | # Construção dos índices de protocolos do SEI |
| 94 | -RUN service solr start && sleep 20 && \ | |
| 93 | +RUN /etc/init.d/solr start && sleep 20 && \ | |
| 95 | 94 | curl 'http://localhost:8983/solr/admin/cores?action=CREATE&name=sei-protocolos&instanceDir=/var/opt/sei/sei-protocolos&config=sei-protocolos-config.xml&schema=sei-protocolos-schema.xml&dataDir=/var/opt/sei/sei-protocolos/conteudo' |
| 96 | 95 | |
| 97 | 96 | # Construção dos índices da base de conhecimento do SEI |
| 98 | -RUN service solr start && sleep 20 && \ | |
| 97 | +RUN /etc/init.d/solr start && sleep 20 && \ | |
| 99 | 98 | curl 'http://localhost:8983/solr/admin/cores?action=CREATE&name=sei-bases-conhecimento&instanceDir=/var/opt/sei/sei-bases-conhecimento&config=sei-bases-conhecimento-config.xml&schema=sei-bases-conhecimento-schema.xml&dataDir=/var/opt/sei/sei-bases-conhecimento/conteudo' |
| 100 | 99 | |
| 101 | 100 | # Construção dos índices de publicações do SEI |
| 102 | -RUN service solr start && sleep 20 && \ | |
| 101 | +RUN /etc/init.d/solr start && sleep 20 && \ | |
| 103 | 102 | curl 'http://localhost:8983/solr/admin/cores?action=CREATE&name=sei-publicacoes&instanceDir=/var/opt/sei/sei-publicacoes&config=sei-publicacoes-config.xml&schema=sei-publicacoes-schema.xml&dataDir=/var/opt/sei/sei-publicacoes/conteudo' |
| 104 | 103 | |
| 105 | 104 | # Construção dos índices de publicações do SEI |
| 106 | -RUN service solr start && sleep 20 && \ | |
| 105 | +RUN /etc/init.d/solr start && sleep 20 && \ | |
| 107 | 106 | curl 'http://localhost:8983/solr/admin/cores?action=RELOAD&core=sei-protocolos' && \ |
| 108 | 107 | curl 'http://localhost:8983/solr/admin/cores?action=RELOAD&core=sei-bases-conhecimento' && \ |
| 109 | 108 | curl 'http://localhost:8983/solr/admin/cores?action=RELOAD&core=sei-publicacoes' | ... | ... |