szabodanika / microbin

A secure, configurable file-sharing and URL shortening web app written in Rust.
https://microbin.eu
BSD 3-Clause "New" or "Revised" License
2.63k stars 160 forks source link

How to pass command line args as env var in docker-compose file? #25

Closed amnesiacsardine closed 2 years ago

amnesiacsardine commented 2 years ago

As the title says. If it is not implemented yet, how else can I change the default behavior?

amnesiacsardine commented 2 years ago

Okay I realized that the CMD bracket in the Docker file is a list so I could add arguments like so CMD ["microbin", "--highlightsyntax", "--private"]

Great that it works but environment variables would obviously be ideal.

szabodanika commented 2 years ago

Hello @amnesiacsardine and welcome! Thanks for raising this issue. I must admit I am not a big Docker expert and I have pretty much no experience in properly dockerising services. I agree with your suggestion though and will look into it. As always, PRs are also very welcome if you happen to know how to solve this. 😃 For now, anyone facing the same issue will definitely find your comment above helpful.

uniqueNullptr2 commented 2 years ago

as an additional reference to amnesiacsardine: you can override the command from the docker-compose as well. no need to rewrite the dockerfile.