0
0
mirror of https://github.com/alex289/CleanArchitecture.git synced 2025-06-29 18:21:08 +00:00

fix: Docker and kubernetes setup

This commit is contained in:
alex289 2024-11-22 13:29:34 +01:00
parent 189b9004b7
commit aa4c16922d
No known key found for this signature in database
GPG Key ID: 573F77CD2D87F863
4 changed files with 8 additions and 8 deletions

View File

@ -44,8 +44,10 @@ To run the project, follow these steps:
Requirements
> This is only needed if running the API locally or only the docker image
1. Redis: `docker run --name redis -d -p 6379:6379 -e ALLOW_EMPTY_PASSWORD=yes redis:latest`
2. Add this to the redis configuration in the Program.cs
1. SqlServer: `docker run --name sqlserver -d -p 1433:1433 -e ACCEPT_EULA=Y -e SA_PASSWORD='Password123!#' mcr.microsoft.com/mssql/server`
1. RabbitMq: `docker run --name rabbitmq -d -p 5672:5672 -p 15672:15672 rabbitmq:4-management`
3. Redis: `docker run --name redis -d -p 6379:6379 -e ALLOW_EMPTY_PASSWORD=yes redis:latest`
4. Add this to the redis configuration in the Program.cs
```csharp
options.ConfigurationOptions = new ConfigurationOptions
{
@ -53,11 +55,10 @@ options.ConfigurationOptions = new ConfigurationOptions
EndPoints = { "localhost", "6379" }
};
```
3. RabbitMq: `docker run --name rabbitmq -d -p 5672:5672 -p 15672:15672 rabbitmq:3-management`
Running the container
1. Build the Dockerfile: `docker build -t clean-architecture .`
2. Run the Container: `docker run -p 80:80 -p 8080:8080 clean-architecture`
2. Run the Container: `docker run --name clean-architecture -d -p 80:80 -p 8080:8080 clean-architecture`
### Using docker-compose

View File

@ -1,4 +1,3 @@
version: "3"
services:
app:
build:
@ -37,7 +36,7 @@ services:
- 1433:1433
redis:
image: docker.io/bitnami/redis:7.4
image: redis:latest
environment:
# ALLOW_EMPTY_PASSWORD is recommended only for development.
- ALLOW_EMPTY_PASSWORD=yes

View File

@ -42,7 +42,7 @@ spec:
protocol: TCP
env:
- name: ASPNETCORE_HTTP_PORTS
value: 80
value: "80"
- name: Kestrel__Endpoints__Http__Url
value: http://+:80
- name: Kestrel__Endpoints__Grpc__Url

View File

@ -27,7 +27,7 @@ spec:
spec:
containers:
- name: redis
image: docker.io/bitnami/redis:7.4
image: redis:latest
env:
# ALLOW_EMPTY_PASSWORD is recommended only for development.
- name: ALLOW_EMPTY_PASSWORD