diff --git a/Readme.md b/Readme.md index 6761e87..722e13b 100644 --- a/Readme.md +++ b/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 diff --git a/docker-compose.yml b/docker-compose.yml index 9bafb9c..5ad1a77 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/k8s-deployments/clean-architecture.yml b/k8s-deployments/clean-architecture.yml index 86140d1..bfdbfba 100644 --- a/k8s-deployments/clean-architecture.yml +++ b/k8s-deployments/clean-architecture.yml @@ -31,4 +31,7 @@ spec: # Replace this with the path to your built image image: alexdev28/clean-architecture:latest ports: - - containerPort: 80 \ No newline at end of file + - 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!# \ No newline at end of file