mirror of https://github.com/statping/statping
port and ip as ENV for docker
parent
83a9044015
commit
3ac519b792
|
@ -30,6 +30,6 @@ WORKDIR /app
|
|||
VOLUME /app
|
||||
EXPOSE $PORT
|
||||
|
||||
HEALTHCHECK --interval=5s --timeout=5s --retries=5 CMD curl -s "http://localhost:8080/health" | jq -r -e ".online==true"
|
||||
HEALTHCHECK --interval=5s --timeout=5s --retries=5 CMD curl -s "http://localhost:$PORT/health" | jq -r -e ".online==true"
|
||||
|
||||
CMD ["statping", "--port", "$PORT"]
|
||||
CMD statping -port $PORT
|
||||
|
|
|
@ -217,7 +217,9 @@ func HelpEcho() {
|
|||
fmt.Println(" -ip 127.0.0.1 - Run HTTP server on specific IP address (default: localhost)")
|
||||
fmt.Println(" -port 8080 - Run HTTP server on Port (default: 8080)")
|
||||
fmt.Printf("Environment Variables:\n")
|
||||
fmt.Println(" STATPING_DIR - Set a absolute path for the root path of Statping server (logs, assets, SQL db)")
|
||||
fmt.Println(" PORT - Set the outgoing port for the HTTP server (or use -port)")
|
||||
fmt.Println(" IP - Bind a specific IP address to the HTTP server (or use -ip)")
|
||||
fmt.Println(" STATPING_DIR - Set a absolute path for the root path of Statping server (logs, assets, SQL db)")
|
||||
fmt.Println(" DB_CONN - Automatic Database connection (sqlite, postgres, mysql)")
|
||||
fmt.Println(" DB_HOST - Database hostname or IP address")
|
||||
fmt.Println(" DB_USER - Database username")
|
||||
|
|
|
@ -51,6 +51,12 @@ func parseFlags() {
|
|||
flag.Parse()
|
||||
ipAddress = *ip
|
||||
port = *p
|
||||
if os.Getenv("PORT") != "" {
|
||||
port = int(utils.ToInt(os.Getenv("PORT")))
|
||||
}
|
||||
if os.Getenv("IP") != "" {
|
||||
ipAddress = os.Getenv("IP")
|
||||
}
|
||||
}
|
||||
|
||||
// main will run the Statping application
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
build:
|
||||
docker:
|
||||
web: Dockerfile
|
||||
web: Dockerfile
|
||||
run:
|
||||
web: statping -port $PORT
|
Loading…
Reference in New Issue