Simple web service for converting images using Pillow-Simd library https://github.com/uploadcare/pillow-simd
GET /health
simply returns Ok
POST /
Image conversion endpoint, accepts the following json:
{
"input": "/absolute/path/to/image.jpg",
"output": {
"/absolute/path/to/result_image1.jpg" : [360, 640],
"/absolute/path/to/result_image2.jpg" : [540, 960],
...
}
}
returns 204 or 404 if input file cannot be found, or 500 in case of other errors
docker build .
docker run -p 5001:5001 -v /host-dir:/container-dir --tmpfs /mem <container_id>
host-dir:/container-dir is for sharing image directories between host and container. multiple volumes could be added for example for input and output directories. The volumes could be used in paths, see the JSON request example above
Number of workers and port can be specified in gunicorn_config.py
Default number of workers = value of WEB_CONCURRENCY environment variable
Content type
Image
Digest
Size
91.4 MB
Last updated
almost 6 years ago
docker pull balaclavalab/psimd-convert