railwayapp / templates

Railway starters
https://railway.app
MIT License
330 stars 150 forks source link

Imgproxy #443

Closed ItzDerock closed 10 months ago

ItzDerock commented 11 months ago

Contact Details

derock@derock.dev (or derock on discord)

Template URL

https://railway.app/template/d7gCBH

What does this template deploy?

430 - Imgproxy

Deploys 1 instance of imgproxy from the darthsim/imgproxy docker image.

Sets up health checks and sets some common/useful environment variables to what I believe are sensible defaults.

I tried using {{ secret(32, "abcdefghijklmnopqrstuvwxyz=/+") }} to auto-generate the key and salt, but the result is not a valid base64 string and imgproxy wouldn't boot.

Examples

These will stay up for as long as needed. imgproxy is very lightweight so I don't care too much about costs. These demos are using a live instance of imgproxy from this template running on Railway.

Original Image (JPG)

image

Downscaled to 1080p and converted to webp

downscaled, 1080p, webp

Cropped to phone wallpaper (2500x1000 webp)

1000x2500

Demo project

No response

ndneighbor commented 10 months ago

Looking really good, going to kickstart the payout process for ya.

melissa-hale commented 10 months ago

Thanks for your patience @ItzDerock , and thank you for a solid template for imgproxy.

Just one action item -

I was able to get a dynamic key/pair generated with the secret() function by passing in: ${{ secret(32, "0123456789ABCDEF") }}

Could you please update your template to use this and test my sanity by confirming it works for you as well? If that checks out, please update your documentation accordingly.

Once I hear back, you'll get an email from me shortly after to arrange the payout!

ItzDerock commented 10 months ago

That works for me! I've updated the template accordingly.