From 189b9004b712fc23705de8c0ada02fe9a6a728c5 Mon Sep 17 00:00:00 2001 From: alex289 Date: Thu, 21 Nov 2024 22:16:00 +0100 Subject: [PATCH] feat: Extend documentation for aspire --- Readme.md | 10 +++++++--- k8s-deployments/clean-architecture.yml | 10 +++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Readme.md b/Readme.md index 357aa6a..764c9f6 100644 --- a/Readme.md +++ b/Readme.md @@ -25,17 +25,21 @@ The project uses the following dependencies: - **gRPC**: gRPC is an open-source remote procedure call framework that enables efficient communication between distributed systems using a variety of programming languages and protocols. ## Running the Project -To run the project, follow these steps: +To run the project, follow these steps: 1. Clone the repository to your local machine. 2. Open the solution in your IDE of choice. 3. Build the solution to restore the dependencies. 4. Update the connection string in the appsettings.json file to point to your database. -5. Start the API project +5. Start the API project (Alterntively you can use the `dotnet run --project CleanArchitecture.Api` command) 6. The database migrations will be automatically applied on start-up. If the database does not exist, it will be created. 7. The API should be accessible at `https://localhost:/api/` where `` is the port number specified in the project properties and `` is the name of the API controller. +### Using Aspire + +1. Run `dotnet run --project CleanArchitecture.AppHost` in the root directory of the project. + ### Using docker Requirements @@ -53,7 +57,7 @@ options.ConfigurationOptions = new ConfigurationOptions Running the container 1. Build the Dockerfile: `docker build -t clean-architecture .` -2. Run the Container: `docker run -p 80:80 clean-architecture` +2. Run the Container: `docker run -p 80:80 -p 8080:8080 clean-architecture` ### Using docker-compose diff --git a/k8s-deployments/clean-architecture.yml b/k8s-deployments/clean-architecture.yml index 92a8910..dc48762 100644 --- a/k8s-deployments/clean-architecture.yml +++ b/k8s-deployments/clean-architecture.yml @@ -6,9 +6,14 @@ spec: selector: app: clean-architecture-app ports: - - protocol: TCP + - name: http + protocol: TCP port: 80 targetPort: 80 + - name: grpc + protocol: TCP + port: 8080 + targetPort: 8080 type: LoadBalancer --- @@ -32,6 +37,9 @@ spec: image: alexdev28/clean-architecture:latest ports: - containerPort: 80 + protocol: TCP + - containerPort: 8080 + protocol: TCP env: - name: ASPNETCORE_HTTP_PORTS value: 80