mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-06-29 10:11:07 +00:00
fix: Docker and kubernetes setup
This commit is contained in:
parent
189b9004b7
commit
aa4c16922d
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user