From d7049150d0428c5cbfdd3bb27c396dd2d9daf1e2 Mon Sep 17 00:00:00 2001 From: Muayyad alsadi Date: Tue, 8 Mar 2022 10:57:44 +0300 Subject: [PATCH] FIXES #447: support --env-file --- podman_compose.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/podman_compose.py b/podman_compose.py index 24e7226..cb5cd70 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -1364,7 +1364,8 @@ class PodmanCompose: self.project_name = project_name - dotenv_path = os.path.join(dirname, ".env") + dotenv_path = os.path.join(dirname, args.env_file) + print(dotenv_path) self.environ = dict(os.environ) dotenv_dict = dotenv_to_dict(dotenv_path) self.environ.update(dotenv_dict) @@ -1539,6 +1540,13 @@ class PodmanCompose: @staticmethod def _init_global_parser(parser): parser.add_argument("-v", "--version", help="show version", action="store_true") + parser.add_argument( + "--env-file", + help="Specify an alternate environment file", + metavar="env_file", + type=str, + default='.env', + ) parser.add_argument( "-f", "--file",