Update environment variable names in config and docker-compose
This commit is contained in:
parent
a88946bb7f
commit
be98920271
|
@ -102,17 +102,17 @@ func configEnvironmentOverrides(Config *Config) {
|
||||||
func LoadConfig() *Config {
|
func LoadConfig() *Config {
|
||||||
// set the config name based on the environment:
|
// set the config name based on the environment:
|
||||||
|
|
||||||
if os.Getenv("CA_ENV") == "local" {
|
if os.Getenv("DT_ENV") == "local" {
|
||||||
viper.SetConfigName("local")
|
viper.SetConfigName("local")
|
||||||
} else if os.Getenv("CA_ENV") == "prod" {
|
} else if os.Getenv("DT_ENV") == "prod" {
|
||||||
viper.SetConfigName("prod")
|
viper.SetConfigName("prod")
|
||||||
} else if os.Getenv("CA_ENV") == "selfhosted" {
|
} else if os.Getenv("DT_ENV") == "selfhosted" {
|
||||||
viper.SetConfigName("selfhosted")
|
viper.SetConfigName("selfhosted")
|
||||||
} else {
|
} else {
|
||||||
viper.SetConfigName("local")
|
viper.SetConfigName("local")
|
||||||
}
|
}
|
||||||
// get logger and log the current environment:
|
// get logger and log the current environment:
|
||||||
fmt.Printf("--ConfigLoad config for environment: %s ", os.Getenv("CA_ENV"))
|
fmt.Printf("--ConfigLoad config for environment: %s ", os.Getenv("DT_ENV"))
|
||||||
|
|
||||||
viper.AddConfigPath("./config")
|
viper.AddConfigPath("./config")
|
||||||
viper.SetConfigType("yaml")
|
viper.SetConfigType("yaml")
|
||||||
|
|
|
@ -15,7 +15,7 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "8085:8000"
|
- "8085:8000"
|
||||||
environment:
|
environment:
|
||||||
- CA_ENV=prod
|
- DT_ENV=prod
|
||||||
hostname: donetick-core
|
hostname: donetick-core
|
||||||
command: ["/donetick-core"] # Command to execute your binary inside the container
|
command: ["/donetick-core"] # Command to execute your binary inside the container
|
||||||
networks:
|
networks:
|
||||||
|
|
Loading…
Reference in New Issue