Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposals to read a directory by default #59

Open
bingryan opened this issue Jul 22, 2020 · 0 comments
Open

Proposals to read a directory by default #59

bingryan opened this issue Jul 22, 2020 · 0 comments

Comments

@bingryan
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant