Make Redis as ENV Var
This commit is contained in:
parent
a522813ffe
commit
876f801e53
4 changed files with 21 additions and 9 deletions
|
@ -5,9 +5,10 @@ services:
|
||||||
image: registry.ucode.space/phil/goshorly:latest
|
image: registry.ucode.space/phil/goshorly:latest
|
||||||
environment:
|
environment:
|
||||||
- HOST=example.org # Domain or IP-Adress
|
- HOST=example.org # Domain or IP-Adress
|
||||||
|
- PORT=3000 # The Port you want to use
|
||||||
- HTTPS=true # If you want to use HTTPS
|
- HTTPS=true # If you want to use HTTPS
|
||||||
- PROXY=true # If you want to use a Reverse Proxy
|
- PROXY=true # If you want to use a Reverse Proxy
|
||||||
- PORT=3000 # The Port you want to use
|
- REDIS_URI=redis # The Redis-URI (name of redis container OOTB)
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
restart: always
|
restart: always
|
||||||
|
|
|
@ -5,9 +5,10 @@ services:
|
||||||
image: registry.ucode.space/phil/goshorly:latest
|
image: registry.ucode.space/phil/goshorly:latest
|
||||||
environment:
|
environment:
|
||||||
- HOST=your_domain_or_ip # Domain or IP-Adress
|
- HOST=your_domain_or_ip # Domain or IP-Adress
|
||||||
|
- PORT=3000 # The Port you want to use
|
||||||
- HTTPS=false # If you want to use HTTPS
|
- HTTPS=false # If you want to use HTTPS
|
||||||
- PROXY=false # If you want to use a Reverse Proxy
|
- PROXY=false # If you want to use a Reverse Proxy
|
||||||
- PORT=3000 # The Port you want to use
|
- REDIS_URI=redis # The Redis-URI (name of redis container OOTB)
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|
22
utils/env.go
22
utils/env.go
|
@ -5,14 +5,17 @@ import (
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
var HOST string
|
var (
|
||||||
var HTTPS string
|
HOST string
|
||||||
var PROXY bool
|
PORT string
|
||||||
var PORT string
|
HTTPS string
|
||||||
|
PROXY bool
|
||||||
var URL string
|
URL string
|
||||||
|
REDIS_URI string
|
||||||
|
)
|
||||||
|
|
||||||
func Init_env_vars() {
|
func Init_env_vars() {
|
||||||
|
|
||||||
UHOST, err := os.LookupEnv("HOST")
|
UHOST, err := os.LookupEnv("HOST")
|
||||||
if !err {
|
if !err {
|
||||||
log.Fatal("HOST enviroment variable not found, please set it!")
|
log.Fatal("HOST enviroment variable not found, please set it!")
|
||||||
|
@ -40,6 +43,13 @@ func Init_env_vars() {
|
||||||
PORT = UPORT
|
PORT = UPORT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UREDIS_URI, err := os.LookupEnv("REDIS_URI")
|
||||||
|
if !err {
|
||||||
|
REDIS_URI = "redis"
|
||||||
|
} else {
|
||||||
|
REDIS_URI = UREDIS_URI
|
||||||
|
}
|
||||||
|
|
||||||
create_string()
|
create_string()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
Made with <a href="https://git.ucode.space/Phil/goshorly"><i class="fas fa-code-branch"></i>
|
Made with <a href="https://git.ucode.space/Phil/goshorly"><i class="fas fa-code-branch"></i>
|
||||||
Phil/goshorly</a>
|
Phil/goshorly</a>
|
||||||
{{ if .GitBuild }}
|
{{ if .GitBuild }}
|
||||||
{{ .GitCommitShort }}/{{ .GitBranch }}
|
| {{ .GitCommitShort }}/{{ .GitBranch }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</center>
|
</center>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
Loading…
Reference in a new issue