tilt
tilt copied to clipboard
Tilt should load COMPOSE_PROJECT_NAME from the .env file
Expected Behavior
docker-compose project name should be loaded from the .env file, if it is present.
Current Behavior
if docker_compose project_name is not specified, than the current directory name is used. docker_compose.go
Context
About Your Use Case
I try to introduce tilt to our developers and we heavily relying on COMPOSE_PROJECT_NAME defined in the dotenv file.
Workaround
As a workaround I added the following lines to my Tiltfile
load('ext://dotenv', 'dotenv')
dotenv()
docker_compose('docker-compose.yml',project_name=os.environ['COMPOSE_PROJECT_NAME'])
thanks for the report! i talked to the compose team about this. the problem is that there's a bunch of subtle order of operations / circular dependency problems in how the dotenv file interacts with the compose file, and how the compose file interacts with tilt. your workaround is a good one.
Thank you, Nick, for your reply. I understand this can be a challenging task. I hope others will find my workaround useful in the meantime. You've done an awesome job with this project. I really love it. ^^