Skip to content

Proposals to read a directory by default #59

Open
@bingryan

Description

@bingryan

I have a proposal to better coordinate the deployment of containers. When we are developing locally, one .env configuration file may be sufficient, but when containers are used, multiple configuration files are often required to be used together.
For example, .envs/.mysql is to provide mysql deployment configure, and .envs/.redis is to provide redis configuration deployment configure。

use std::env;

fn main() {
    //  Read all configuration files in the following directory
    // .envs
    //     .envs/.elasticsearch
    //     .envs/.redis
    //     .envs/mysql
    //     .envs/mysql/.mysql2
    //     .envs/mysql/.mysql1

    use dotenv;
    dotenv::dotenvs().ok();
    for (key, value) in env::vars() {
        println!("{}: {}", key, value);
    }
}

In this way, I developed well with docker-compose.

I have implemented the logic, if it feels good, I will PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions