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

Use environment-based Docker image in Docker-compose #105

Closed
wants to merge 1 commit into from

Conversation

jnsereko
Copy link
Collaborator

@jnsereko jnsereko commented Jan 19, 2024

The idea here is to use Hashicorp Vault and direnv to automate env secrets.

The ideology is simple

  • Install and setup Hashicorp Vault and direnv locally
  • go to the home directory of this repo and run direnv allow . ( otherwise direnv will not load the env files)
  • we shall have a simple private script to run once, which will set secrete data ie, database user, password, name etc
  • we first load the secrets in the envrc using direnv
  • run direnv source_env .env.dev for dev environment or direnv source_env .env.qa for the qa environment
  • finally do our usual docker compose up

I am open for further discussion on this
cc @michaelbontyes

@sherrif10
Copy link
Contributor

You got failures on this repo @jnsereko

@jnsereko
Copy link
Collaborator Author

You got failures on this repo @jnsereko

Upload Configuration Artifact should fail. Looking into Build and Validate Configuration

@jnsereko
Copy link
Collaborator Author

closing this because i have a better approach
I will reopen when this approach turns out better

@jnsereko jnsereko closed this Jan 22, 2024
@jnsereko
Copy link
Collaborator Author

uncertified logic in this is when we have different secretes for both qa and dev

Solution:
Creating different variables for secretes ie having QA_OPENMRS_DB_USER and DEV_OPENMRS_DB_USER and dynamically loading these variable in the docker compose file

@sherrif10
Copy link
Contributor

Makes sense, In that case you can manage different configs for different variables.

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.

2 participants