-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
Configure reading .env
files
#254
Comments
Teach me wrong, but would this setting more be a global setting, not a project specific setting? |
I don't personally need it set per-project at the moment (I'm only using docker-sync for one project), but I could see a use case for it. Different projects may have different expectations for how |
P.S. I would be fine configuring this in |
i see, i personally have no usage for .env that why i ask for the use cases. What do you think, are you able to provide a PR? I am currently not even quiet sure when initialize is run, since DockerSyncConfig seems to be used statically only, never Well you have to dig into it yourself right now, i cannot dedicate time to you right now, sorry |
I understand that you can't work on this immediately. I won't be able to look into a PR just yet, but I might take a look at the code when I have some time off of work. Thank you for your prompt responses to my issue. |
Fair enough i guess, lets see how we can wrap this up :) |
One possible intermediate solution that would at least get rid of the errors would be to remove usage of dotenv in favor of function that skips over non-envvar lines (e.g. I've suggested that dotenv implement this behavior: bkeepers/dotenv#285 . |
You could go the other way around and specify a different file to use for autoenv instead of |
@matleh Good idea. I'll do that in the meantime. |
We use |
There is no timeline here, specificly i do not plan to work on this feature myself yet. Sure iam happy for any contribution or pull request |
Wouldn't it be the easiest thing to add an env-var DOCKER_SYNC_ENV_FILE which can be used to overwrite the location of the docker-sync .env file? Then people are free to either set that variable in their shell init script or people using autoenv can use that to overwrite DOCKER_SYNC_ENV_FILE on a per-project basis. But that would introduce another "place" for configuration. @EugenMayer what do you think of that? |
Why not, sounds reasonable. We just should default to .env, but making in configureable is something simple and effective |
Thank you @matleh for joining forces here an implementing DOCKER_SYNC_ENV_FILE, i adjusted the docs https:/EugenMayer/docker-sync/wiki/Variable-Replace---Dynamic-Configuration - thank you! |
#230 introduced support for reading
.env
files and using envvards in docker-sync configuration.I use autoenv in order to do more than just set environment variables in my
.env
file (setting my Python virtual environment, for example). Therefore, I get an error when I rundocker-sync start
:One solution to this would be to add a configuration option that allows a user to specify which file to read envvars from. This would look something like
If set to
null
orfalse
, no env file will be read.Thoughts?
The text was updated successfully, but these errors were encountered: