1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2024-11-24 08:12:38 +02:00

Deploy to Heroku without custom buildpack

This commit is contained in:
DarthSim 2017-09-30 06:10:41 +06:00
parent 76efe15472
commit 5a46f542c6
3 changed files with 9 additions and 3 deletions

2
Aptfile Normal file
View File

@ -0,0 +1,2 @@
:repo:deb http://ppa.launchpad.net/dhor/myway/ubuntu xenial main
libvips-dev

View File

@ -17,8 +17,7 @@
}
},
"buildpacks": [
{
"url": "https://github.com/DarthSim/heroku-buildpack-imgproxy"
}
{ "url": "https://github.com/heroku/heroku-buildpack-apt" },
{ "url": "https://github.com/heroku/heroku-buildpack-go" }
]
}

View File

@ -4,6 +4,7 @@ import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
@ -96,6 +97,10 @@ func init() {
saltpath := flag.String("saltpath", "", "path of the file with hex-encoded salt")
flag.Parse()
if port := os.Getenv("PORT"); len(port) > 0 {
conf.Bind = fmt.Sprintf(":%s", port)
}
strEnvConfig(&conf.Bind, "IMGPROXY_BIND")
intEnvConfig(&conf.ReadTimeout, "IMGPROXY_READ_TIMEOUT")
intEnvConfig(&conf.WriteTimeout, "IMGPROXY_WRITE_TIMEOUT")