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

Environment Variables #3

Open
safesploit opened this issue Jan 28, 2024 · 4 comments
Open

Environment Variables #3

safesploit opened this issue Jan 28, 2024 · 4 comments

Comments

@safesploit
Copy link
Owner

safesploit commented Jan 28, 2024

Store sensitive environment variables (like database passwords) securely in a .env file and use them in docker-compose.yml.

This will make it easier to manage sensitive information without exposing it directly in the configuration.

@safesploit
Copy link
Owner Author

Create a .env File

Create a .env file in the same directory as docker-compose.yml.

APACHE_PORT=8080
MYSQL_ROOT_PASSWORD=mysecretpassword

@safesploit
Copy link
Owner Author

Hard-coded values

  • build.sh
  • config/doogle-user.sql

Modify docker-compose.yml

At present docker-compose.yml already uses environment variables. So we can ignore the need to replace hard-coded values in the docker-compose.yml.

Modify build.sh

build.sh has hard-coded values

This can be resolved as such:

hard-coded

link

$dbpass = "PASSWORD_HERE";

environment variable

\$dbpass = '${MYSQL_ROOT_PASSWORD}';

@safesploit
Copy link
Owner Author

.gitignore

# macOS system files
.DS_Store

# Ignore directories containing generated files (add more as needed)
/vendor/
/node_modules/

@safesploit
Copy link
Owner Author

Use a Secrets Manager

HashiCorp Vault

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

No branches or pull requests

1 participant