Sign inSign up

ambroisemaupate/intervention-request

By ambroisemaupate

•Updated about 1 year ago

Images on-the-fly resampling server based on URL with configurable storage and cache.

Image
Integration & delivery
Developer tools
Web servers
1

2.8K

ambroisemaupate/intervention-request repository overview

⁠Intervention Request

A customizable Intervention Image wrapper to use image simple re-sampling features over urls and a configurable cache.

Static analysis and code style Packagist Packagist

⁠Ready-to-go Docker image

Intervention Request is now available as a standalone Docker server to use with whatever CMS or language you need. It declares two volumes: one for your images storage and one for cached files.

  • /app/public/images: you can set it as read-only to prevent any write operation
  • /app/public/assets: you must set it as read-write to allow cache files to be written
docker pull ambroisemaupate/intervention-request;
# Make sure to share your volume with READ-ONLY flag
docker run -v "/my/images/folder:/app/public/images:ro" -p 8080:80/tcp ambroisemaupate/intervention-request;

Garbage collector runs every hour as a crontab job and will purge cache files created more than $IR_GC_TTL seconds ago. You still can execute it manually using docker compose exec -u www-data intervention bin/intervention gc:launch command.

⁠Use local file-system or a distant one

InterventionRequest is built on Flysystem⁠ library to abstract access to your native images. Then you can store all your images on an AWS bucket or a Scaleway Object Storage and process them on the fly. Processed images are still cached on InterventionRequest local storage. This new file system abstraction layer allows multiple InterventionRequest docker containers to run in parallel but still use the same storage as image backend, or simply detach your media storage logic from InterventionRequest application.

InterventionRequest object requires a FileResolverInterface which can be a LocalFileResolver or FlysystemFileResolver, then FlysystemFileResolver must be provided a League\Flysystem\Filesystem object configured with any Flysystem adapter.

If you prefer to use ambroisemaupate/intervention-request Docker image, environment variables are available for AWS adapter only.

⁠Docker Compose example
version: '3'
services:
    intervention:
        image: ambroisemaupate/intervention-request:7.0.2
        #image: ambroisemaupate/intervention-request:frankenphp-7.0.2
        volumes:
            - cache:/app/public/assets
            ## If using local storage file system
            - ./my/images/folder:/app/public/images:ro
        # You can override some defaults below
        environment:
            IR_DEBUG: 0
            IR_DEFAULT_QUALITY: 80
            ## If using local storage file system
            IR_IMAGES_PATH: /app/public/images
            ## If using an AWS or Scaleway Object storage file system 
            IR_AWS_ACCESS_KEY_ID: 'changeme'
            IR_AWS_ACCESS_KEY_SECRET: 'changeme'
            IR_AWS_ENDPOINT: 'https://s3.fr-par.scw.cloud'
            IR_AWS_REGION: 'fr-par'
            IR_AWS_BUCKET: 'my-bucket'
            IR_AWS_PATH_PREFIX: 'images'
        ports:
            - 8080:80/tcp
        # Uncomment lines below for Traefik usage
        #labels:
        #    - "traefik.enable=true"
        #    - "traefik.http.services.intervention.loadbalancer.server.scheme=http"
        #    - "traefik.http.services.intervention.loadbalancer.server.port=80"
        #    - "traefik.http.services.intervention.loadbalancer.passhostheader=true"
        #    # Listen HTTP
        #    - "traefik.http.routers.intervention.entrypoints=http"
        #    - "traefik.http.routers.intervention.rule=Host(`intervention.test`)"
        #    - "traefik.http.routers.intervention.service=intervention"
        #networks:
        #    - default
        #    - frontproxynet
volumes:
    cache:

⁠License

Intervention Request is handcrafted by Ambroise Maupate under MIT license.

Have fun!

Tag summary

Content type

Image

Digest

sha256:9e69f9758…

Size

219.2 MB

Last updated

about 1 year ago

docker pull ambroisemaupate/intervention-request