tripviss / image-resizer

On-the-fly image resizing using Node.js and libvips. Heroku Ready!
MIT License
73 stars 45 forks source link

Production ready ? #21

Open maxs15 opened 8 years ago

maxs15 commented 8 years ago

Hey @teohhanhui,

Good job on this fork ! It looks like https://github.com/jimmynicol/image-resizer isn't maintained anymore.. I just wanted to get some feedback from you about this library, are you using it in production ? Any issue known about using it ? I'm still wondering if I should use on the fly resize with image-resizer or use AWS lambda to automatically convert my images.

Would appreciate some of your wisdom :)

Thanks

teohhanhui commented 8 years ago

Yes, we're using it in production (https://static.tripviss.com on KeyCDN). :smile:

For known issues just refer to: https://github.com/tripviss/image-resizer/issues :stuck_out_tongue:

We are using Docker, so we don't really see the appeal of AWS Lambda which is more restrictive and less portable. Here is our Docker image: https://hub.docker.com/r/tripviss/image-resizer/ (repo at https://github.com/tripviss/docker-image-resizer). Feel free to use it, or modify from there.

We also have a Docker Compose setup here: https://github.com/tripviss/tripviss-image-proxy which you can pick up and go with minimal modifications.

maxs15 commented 8 years ago

Sweet ! :) You're right, On-the-fly resizing is so much easier... I'm thinking about deploying it on AWS ElasticBeans for automatic scaling. Never tried KeyCDN but it looks great and maybe cheaper than CloudFront, it may worth a try ;) Have you tried https://github.com/thumbor/thumbor ?

teohhanhui commented 8 years ago

I still think image-resizer's greatest asset is its use of VIPS (via sharp).

We were introduced to VIPS by http://rsz.io which is really fast! And it comes with powerful filters! And it is behind a CDN to boot!(not sure) And the whole service is supposedly free*!

The only downside? It was problematic for HTTPS, due to the use of wildcard subdomains. Might not be an issue anymore thanks to Let's Encrypt?(No, I forgot they don't do wildcard certs...)

* not sure to what extent

teohhanhui commented 8 years ago

@leesiongchan In hindsight we could have just used rsz.io with a HTTPS proxy... Or do we want to consider making the switch? :laughing:

maxs15 commented 8 years ago

Thanks for the details @teohhanhui ! Decided to use image-resizer ! 🎉 I may send you some PR if I find something to improve ^^

lasconic commented 8 years ago

FWIW, AWS lambda is not an option for this for the moment. See https://clifff.com/2015/10/01/2015-failed-experiments-with-aws-lambda/ It's from last year but as far as I understand, the problem remains. It's not possible to output binary images from Lambda/API Gateway.

maxs15 commented 8 years ago

@lasconic, I was talking about pre-generating (No on-the-fly resizing) the images using Aws Lambda, which is pretty easy considering you can get an event when an object is added in your bucket. (https://github.com/ysugimoto/aws-lambda-image) Performing on-the-fly resizing using Lambda is another story.. very interesting article ! 👍

vprasanth commented 8 years ago

@teohhanhui Hey, first off, great work! :) I was wondering, how do you pass the environment settings to the docker container? Do you mount a volume or set environment variables directly in the run command with ENV?

teohhanhui commented 8 years ago

@vprasanth You can refer to our production setup at https://github.com/tripviss/tripviss-image-proxy :smile:

teohhanhui commented 8 years ago

But of course the "nginx-ssl" container need not be there.

We're switching to https://github.com/jwilder/nginx-proxy + https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion