yaml configuration removed to simplify deploy and development
This commit is contained in:
parent
02068a71ed
commit
261014d24d
@ -45,14 +45,12 @@ For SSL, authentication, domains, etc. - use Caddy or Nginx (no specific configu
|
|||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|
||||||
Configuration is done using [config.yml](config.yml) file or env vars
|
Configuration is done using environment variables
|
||||||
|
|
||||||
Env vars always has precedence over config.yml
|
|
||||||
|
|
||||||
Docker-compose deployment uses [deploy/.env file](deploy/.env)
|
|
||||||
|
|
||||||
You can see all available options in [config.go file](internal/config/config.go) (struct Config)
|
You can see all available options in [config.go file](internal/config/config.go) (struct Config)
|
||||||
|
|
||||||
|
Docker-compose deployment uses [deploy/.env file](deploy/.env)
|
||||||
|
|
||||||
### Scaling
|
### Scaling
|
||||||
|
|
||||||
Each worker can process 1 page at a time, so to scale you should run multiple worker instances. This is done using replicas parameter in worker section in [docker-compose.yml file](deploy/docker-compose.yml)
|
Each worker can process 1 page at a time, so to scale you should run multiple worker instances. This is done using replicas parameter in worker section in [docker-compose.yml file](deploy/docker-compose.yml)
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
webserver_address: "0.0.0.0:5000"
|
|
||||||
nats_url: "nats://localhost:4222"
|
|
||||||
debug: true
|
|
||||||
@ -10,15 +10,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
WebserverAddress string `yaml:"webserver_address" env:"WEBSERVER_ADDRESS" env-required:"true" validate:"hostname_port"`
|
WebserverAddress string `env:"WEBSERVER_ADDRESS" env-default:"0.0.0.0:5000" validate:"hostname_port"`
|
||||||
NatsUrl string `yaml:"nats_url" env:"NATS_URL" env-required:"true" validate:"url"`
|
NatsUrl string `env:"NATS_URL" env-default:"nats://localhost:4222" validate:"url"`
|
||||||
Debug bool `yaml:"debug" env:"DEBUG"`
|
Debug bool `env:"DEBUG"`
|
||||||
Proxy string `yaml:"proxy" env:"PROXY" env-default:"" validate:"omitempty,proxy"`
|
Proxy string `env:"PROXY" env-default:"" validate:"omitempty,proxy"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func Read() (Config, error) {
|
func Read() (Config, error) {
|
||||||
var cfg Config
|
var cfg Config
|
||||||
err := cleanenv.ReadConfig("config.yml", &cfg)
|
err := cleanenv.ReadEnv(&cfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return Config{}, err
|
return Config{}, err
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user