Skip to content
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

Docker support config via env vars #49

Merged

Conversation

Codycody31
Copy link
Contributor

@Codycody31 Codycody31 commented Mar 21, 2024

Changes

  • Add a .env.example file for the environmental variables we support
  • Add CLI cmd inject-config to return a yaml file with the config containing env vars
  • Add docker-compose.yml and update entrypoint.sh script
  • Incorporate a script in the UI called generate-yaml.js to generate a new file called ui-config.yaml which is not included in git.

Purpose

This PR now adds support for using environment variables making it way easier to run discuit via docker.

Related Issues

Requests When Reviewing

I didn't know how the cmd in main.go should be so it is called inject-config but it's most definitely free to be changed to a better name, as the current one was just a test/general and the purpose has changed.

@Codycody31 Codycody31 marked this pull request as ready for review March 21, 2024 14:11
config/config.go Outdated Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
@Codycody31
Copy link
Contributor Author

Codycody31 commented Jun 8, 2024

Everything works now, the only thing that could probably be added would be a way to auto-generate the environment variables based on the struct rather than manually defining them, example here. However, it could always be added in a future PR.

@previnder
Copy link
Member

We could indeed use reflection for that, but I'm going to merge this one right now. But yeah that could be a future PR.

@previnder previnder merged commit af474de into discuitnet:main Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Docker: Support Configuration via Environment Variables
2 participants