feat: update Docker configuration and environment handling
- Added PostgreSQL service to docker-compose.yml with health checks and persistent storage. - Updated bot service to use environment variable substitution for database connection string. - Upgraded Go version in Dockerfile to 1.26.1-alpine. - Modified config loading to ignore missing .env file for better compatibility with Docker.
This commit is contained in:
@@ -18,9 +18,8 @@ type Config struct {
|
||||
}
|
||||
|
||||
func LoadConfig() (*Config, error) {
|
||||
if err := godotenv.Load(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Load .env if present (e.g. local dev). Ignore if missing (e.g. Docker injects env vars).
|
||||
_ = godotenv.Load()
|
||||
|
||||
token := os.Getenv("BOT_TOKEN")
|
||||
if token == "" {
|
||||
|
||||
Reference in New Issue
Block a user