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

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")