mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-06-30 02:31:08 +00:00
feat: Use differente connection strings for different envs
This commit is contained in:
parent
56be506f0c
commit
fe99c83975
10
Readme.md
10
Readme.md
@ -57,15 +57,13 @@ Running the container
|
||||
|
||||
### Using docker-compose
|
||||
|
||||
1. Change the ConnectionString in the appsettings.json to `Server=db;Database=clean-architecture;Trusted_Connection=False;MultipleActiveResultSets=true;TrustServerCertificate=True;User Id=SA;Password=Password123!#`
|
||||
2. Build the Dockerfile: `docker build -t clean-architecture .`
|
||||
3. Running the docker compose: `docker-compose up -d` (Delete: `docker-compose down`)
|
||||
1. Build the Dockerfile: `docker build -t clean-architecture .`
|
||||
2. Running the docker compose: `docker-compose up -d` (Delete: `docker-compose down`)
|
||||
|
||||
### Using Kubernetes
|
||||
|
||||
1. Change the ConnectionString in the appsettings.json to `Server=sql-server;Database=clean-architecture;Trusted_Connection=False;MultipleActiveResultSets=true;TrustServerCertificate=True;User Id=SA;Password=Password123!#`
|
||||
2. Build the docker image and push it to the docker hub (Change the image name in the `k8s-deployment.yml` to your own)
|
||||
Apply the deployment file: `kubectl apply -f k8s-deployment.yml` (Delete: `kubectl delete -f k8s-deployment.yml`)
|
||||
1. Build the docker image and push it to the docker hub (Change the image name in the `k8s-deployment.yml` to your own)
|
||||
2. Apply the deployment file: `kubectl apply -f k8s-deployment.yml` (Delete: `kubectl delete -f k8s-deployment.yml`)
|
||||
|
||||
|
||||
## Running the Tests
|
||||
|
@ -13,6 +13,8 @@ services:
|
||||
condition: service_healthy
|
||||
links:
|
||||
- db
|
||||
environment:
|
||||
- ConnectionStrings__DefaultConnection=Server=db;Database=clean-architecture;Trusted_Connection=False;MultipleActiveResultSets=true;TrustServerCertificate=True;User Id=SA;Password=Password123!#
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "--fail", "http://localhost/healthz"]
|
||||
interval: 30s
|
||||
|
@ -31,4 +31,7 @@ spec:
|
||||
# Replace this with the path to your built image
|
||||
image: alexdev28/clean-architecture:latest
|
||||
ports:
|
||||
- containerPort: 80
|
||||
- containerPort: 80
|
||||
env:
|
||||
- name: ConnectionStrings__DefaultConnection
|
||||
value: Server=sql-server;Database=clean-architecture;Trusted_Connection=False;MultipleActiveResultSets=true;TrustServerCertificate=True;User Id=SA;Password=Password123!#
|
Loading…
Reference in New Issue
Block a user