-
Notifications
You must be signed in to change notification settings - Fork 517
docker-compose like environment variables syntax #657
Description
What should we add or change to make your life better?
There are 3 changes I would like to have
- Allow to specify environment variables using the docker-compose syntax
Example:
name: demo-envvars
services:
- name: console
project: console/console.csproj
env:
- SOME_VAR_1=SOME_VALUE
- SOME_VAR_2="SOME VALUE WITH SPACES"
The wouldn't replace the old syntax (having to explicitly write name
and value
), but only provide an alternative
- Allow to pass external environment variables to tye, per the docker-compose syntax
You should be able to specify the names of the environment variables you'd want to pass from the external environment (shell/etc...). Tye would read the values from the environment and pass them into the service
Example:
name: demo-envvars
services:
- name: console
project: console/console.csproj
env:
- SOME_VAR_1
- SOME_VAR_2
(This should also work with the existing env vars syntax, if you specify a name
without a value
)
- Allow to specify the path to an env file, per the docker-compose syntax
The env file would have this syntax
SOME_VAR_1=SOME_VALUE
SOME_VAR_2="SOME VALUE WITH SPACES"
and to reference it in tye.yaml
you would do
name: demo-envvars
services:
- name: console
project: console/console.csproj
env_file:
- my_vars_1.env
- my_vars_2.env
(You would be able to specify multiple files)
Why is this important to you?
-
The current syntax for environment variables feels overly verbose, compared to docker-compose's syntax, especially, when dealing with 5~10+environment variables.
-
It would make it much more convenient to copy variables from docker-compose to tye or vice-versa
If this sounds fine, I can implement it. Let me know