| .DS_Store | .DS_Store | ||||
| solrdata |
| Docker Compose and Docker files for deploying the development environment for the Politics of Patent case study site. | |||||
| Deployed Solr for .rtf indexing using instructions at: https://github.com/docker-solr/docker-solr | |||||
| Created core using: | |||||
| `docker exec -it solr solr create_core -c epo_data` | |||||
| Add files to Solr using: | |||||
| `docker run --rm -v "/Users/ad7588/Downloads/2018 (10381):/2018" --network=host solr:latest post -c epo_data /2018` | |||||
| Note this fix to ensure that .rtf files can be indexed using Apache Tika: https://gitmemory.com/issue/docker-solr/docker-solr/341/682877640 | |||||
| Note that on Mac the PHP container has to communicate with the Solr container using the hostname 'host.docker.internal' rather than 'localhost' or '127.0.0.1': https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach |
| version: '3.8' | |||||
| services: | |||||
| php: | |||||
| container_name: php | |||||
| build: | |||||
| context: ./php | |||||
| ports: | |||||
| - '9000:9000' | |||||
| volumes: | |||||
| - ./public:/var/www/html | |||||
| nginx: | |||||
| container_name: nginx | |||||
| image: nginx:latest | |||||
| ports: | |||||
| - '8080:80' | |||||
| volumes: | |||||
| - ./public:/var/www/html | |||||
| - ./nginx/default.conf:/etc/nginx/conf.d/default.conf | |||||
| depends_on: | |||||
| - php | |||||
| solr: | |||||
| container_name: solr | |||||
| image: solr:latest | |||||
| ports: | |||||
| - '8983:8983' | |||||
| volumes: | |||||
| - ./solrdata:/var/solr |
| server { | |||||
| listen 80; | |||||
| index index.php; | |||||
| server_name localhost; | |||||
| root /var/www/html; | |||||
| error_log /var/log/nginx/project_error.log; | |||||
| access_log /var/log/nginx/project_access.log; | |||||
| location / { | |||||
| try_files $uri /index.php$is_args$args; | |||||
| } | |||||
| location ~ ^/index\\.php(/|$) { | |||||
| fastcgi_pass php:9000; | |||||
| fastcgi_split_path_info ^(.+\\.php)(/.*)$; | |||||
| include fastcgi_params; | |||||
| fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; | |||||
| fastcgi_param DOCUMENT_ROOT $realpath_root; | |||||
| fastcgi_buffer_size 128k; | |||||
| fastcgi_buffers 4 256k; | |||||
| fastcgi_busy_buffers_size 256k; | |||||
| internal; | |||||
| } | |||||
| location ~ \\.php$ { | |||||
| return 404; | |||||
| } | |||||
| } |
| FROM php:8.0-fpm | |||||
| #RUN apt update \ | |||||
| # && apt install -y zlib1g-dev g++ git libicu-dev zip libzip-dev zip \ | |||||
| # && docker-php-ext-install intl opcache pdo pdo_mysql \ | |||||
| # && pecl install apcu \ | |||||
| # && docker-php-ext-enable apcu \ | |||||
| # && docker-php-ext-configure zip \ | |||||
| # && docker-php-ext-install zip |
| ?> | ?> | ||||
| Application ID: | |||||
| <?php | |||||
| // Search for the title in the content element and display it | |||||
| $content = $json->response->docs[$random]->content; | |||||
| preg_match('/Application.*\n(.*)\n/', $content, $application_id); | |||||
| print_r($application_id[1]); | |||||
| ?> | |||||
| <br><br> | |||||
| EPO publication: | |||||
| <?php | |||||
| // Search for the title in the content element and display it | |||||
| $content = $json->response->docs[$random]->content; | |||||
| preg_match('/Publication.*\n(.*)\n/', $content, $publication); | |||||
| print_r($publication[1]); | |||||
| ?> | |||||
| <br><br> | |||||
| Title: | Title: | ||||
| <?php | <?php |