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 compose cleanup #2248

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 24 additions & 16 deletions .env
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
SQLSERVER_PASSWORD=Password12!
SQLSERVER_PORT=1833
# Docker Ports exposed by the containers
ELASTICSEARCH_PORT=9200
REDIS_PORT=6379
POSTGRES_USER=postgres
POSTGRES_PASSWORD=Password12!
POSTGRES_PORT=8010
EVENTSTORE_PORT=1113
EVENTSTORE_GRPC_PORT=2113
EVENTSTORE_PORT=1113
FTP_PORT=21
IDSVR_PORT=8888
KAFKA_PORT=9092
LOCALSTACK_UI_PORT=42000
MONGODB_PORT=27017
MYSQL_PORT=3306
MYSQL_PASSWORD=Password12!
ZOOKEEPER_PORT=3000
KAFKA_PORT=9092
RABBITMQ_PORT=5672
IDSVR_PORT=8888
ORACLE_PORT=1521
POSTGRES_PORT=8010
RABBITMQ_PORT=5672
RAVENDB_PORT=9030
REDIS_PORT=6379
SFTP_PORT=22
FTP_PORT=21
FTP_USER=bob
SOLR_PORT=8983
SQLSERVER_PORT=5433
ZOOKEEPER_SECURE_PORT=2281

#Docker Secret Usernames and Passwords
ARANGO_ROOT_PASSWORD=Password12!
FTP_PASS=12345
RAVENDB_PORT=9030
SOLR_PORT=8983
FTP_USER=bob
IBM_MQ_PASSWORD=Password12!
INFLUXDB_USER=ci_user
INFLUXDB_PASSWORD=Password12!
MYSQL_PASSWORD=Password12!
POSTGRES_PASSWORD=Password12!
POSTGRES_USER=postgres
SQLSERVER_SA_PASSWORD=Password12!
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -699,4 +699,35 @@ answering [questions](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthCh
2. Follow the code guidelines and conventions.
3. New features are not only code, tests and documentation are also mandatory.
4. PRs with [`Ups for grabs`](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/labels/Ups%20for%20grabs)
and [help wanted](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/labels/help%20wanted) tags are good candidates to contribute.
and [help wanted](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/labels/help%20wanted) tags are good candidates to contribute.

### Running tests locally

Before submitting PRs for code changes, you should run the test suit locally. You can run the unit tests using the following commands:

```Powershell
# Navigate to the solution folder
cd $env:USERPROFILE\source\repos\AspNetCore.Diagnostics.HealthChecks

# Configure Docker Desktop to run include all the containers required for the tests.
# Confirm: Status = Running
docker-compose up

# Run unit and integration tests.
dotnet test

# Tear down the containers after your completed
docker-compose down -v
```

In [Docker Compose](https://docs.docker.com/compose/compose-file/), it’s recommended to use secrets rather than environment variables or a .env file for sensitive information. The `.env` provided separates the sensitive secrets out, to facilitate moving those to secrets. The docker-componse.yml file include variable [interpolation](https://docs.docker.com/compose/compose-file/12-interpolation/) that provide a range of advanced variable substitution syntaxs like:

```text
${VAR:-default} -> value of VAR if set and non-empty, otherwise default
```

1. **Secrets**: Docker Compose allows you to define secrets using the [top-level secrets](https://docs.docker.com/compose/compose-file/09-secrets/) element in your Compose file. Secrets can include sensitive data like passwords, certificates, or API keys. You can grant access to secrets on a per-service basis, which provides granular control within a service container via standard filesystem permissions

2. **env File**: Instead of specifying secrets directly in the Docker Compose file, you can use an environment file (e.g., .env). However, this approach doesn’t provide the same granular control as secrets

3. **Environment Variables**: While you can use environment variables to pass sensitive information, it’s not recommended. Environment variables are often available to all processes, can be difficult to track, and may inadvertently expose information in logs during debugging
Empty file.
Loading
Loading