mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-07-10 15:54:58 +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
|
### 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!#`
|
1. Build the Dockerfile: `docker build -t clean-architecture .`
|
||||||
2. Build the Dockerfile: `docker build -t clean-architecture .`
|
2. Running the docker compose: `docker-compose up -d` (Delete: `docker-compose down`)
|
||||||
3. Running the docker compose: `docker-compose up -d` (Delete: `docker-compose down`)
|
|
||||||
|
|
||||||
### Using Kubernetes
|
### 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!#`
|
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. 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`)
|
||||||
Apply the deployment file: `kubectl apply -f k8s-deployment.yml` (Delete: `kubectl delete -f k8s-deployment.yml`)
|
|
||||||
|
|
||||||
|
|
||||||
## Running the Tests
|
## Running the Tests
|
||||||
|
@ -13,6 +13,8 @@ services:
|
|||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
links:
|
links:
|
||||||
- db
|
- db
|
||||||
|
environment:
|
||||||
|
- ConnectionStrings__DefaultConnection=Server=db;Database=clean-architecture;Trusted_Connection=False;MultipleActiveResultSets=true;TrustServerCertificate=True;User Id=SA;Password=Password123!#
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "--fail", "http://localhost/healthz"]
|
test: ["CMD", "curl", "--fail", "http://localhost/healthz"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
@ -31,4 +31,7 @@ spec:
|
|||||||
# Replace this with the path to your built image
|
# Replace this with the path to your built image
|
||||||
image: alexdev28/clean-architecture:latest
|
image: alexdev28/clean-architecture:latest
|
||||||
ports:
|
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