Selaa lähdekoodia

installed ImageMagick in the PHP Docker container

main
Simon Bowie 2 vuotta sitten
vanhempi
commit
fa1ca3939b
4 muutettua tiedostoa jossa 13 lisäystä ja 4 poistoa
  1. +1
    -1
      docker-compose.yml
  2. +9
    -0
      php/Dockerfile
  3. +2
    -2
      site/ops_api.php
  4. +1
    -1
      site/public/ops_image.php

+ 1
- 1
docker-compose.yml Näytä tiedosto

@@ -4,7 +4,7 @@ services:

php:
container_name: php
image: php:8.0-fpm
build: ./php
env_file:
- config.env
volumes:

+ 9
- 0
php/Dockerfile Näytä tiedosto

@@ -0,0 +1,9 @@
FROM php:8.0-fpm

RUN apt-get update && apt-get install -y libmagickwand-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*

# install imagick
# Version is not officially released https://pecl.php.net/get/imagick but following works for PHP 8
RUN mkdir -p /usr/src/php/ext/imagick; \
curl -fsSL https://github.com/Imagick/imagick/archive/06116aa24b76edaf6b1693198f79e6c295eda8a9.tar.gz | tar xvz -C "/usr/src/php/ext/imagick" --strip 1; \
docker-php-ext-install imagick;

+ 2
- 2
site/ops_api.php Näytä tiedosto

@@ -8,12 +8,12 @@
# @purpose: Performs functions against the European Patent Office's Open Patent Services (OPS) API
# @acknowledgements:
# OPS documented at https://www.epo.org/searching-for-patents/data/web-services/ops.html
# OPS RESTful API specification at http://documents.epo.org/projects/babylon/eponet.nsf/0/F3ECDCC915C9BCD8C1258060003AA712/$File/ops_v3.2_documentation_-_version_1.3.16_en.pdf
# OPS RESTful API specification at http://documents.epo.org/projects/babylon/eponet.nsf/0/F3ECDCC915C9BCD8C1258060003AA712/$File/ops_v3.2_documentation_-_version_1.3.18_en.pdf
# OPS API functions list at https://developers.epo.org/ops-v3-2/apis

function get_access_token() {

// OPS API credentials (details at http://documents.epo.org/projects/babylon/eponet.nsf/0/F3ECDCC915C9BCD8C1258060003AA712/$File/ops_v3.2_documentation_-_version_1.3.16_en.pdf)
// OPS API credentials (details at http://documents.epo.org/projects/babylon/eponet.nsf/0/F3ECDCC915C9BCD8C1258060003AA712/$File/ops_v3.2_documentation_-_version_1.3.18_en.pdf)
$ops_url = $_ENV["OPS_URL"] . '3.2/auth/accesstoken';
$auth = base64_encode($_ENV["CONSUMER_KEY"] . ":" . $_ENV["CONSUMER_SECRET"]);


+ 1
- 1
site/public/ops_image.php Näytä tiedosto

@@ -16,7 +16,7 @@ if(isset($_GET["doc_ref"])){
//Display the image in the browser
header('Content-type: application/pdf');
echo $image_output;
}

?>

Loading…
Peruuta
Tallenna