Skip to content

Commit

Permalink
fix: Docker and kubernetes setup
Browse files Browse the repository at this point in the history
  • Loading branch information
alex289 committed Nov 22, 2024
1 parent 189b900 commit aa4c169
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
9 changes: 5 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,21 @@ 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
{
AbortOnConnectFail = false,
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

Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3"
services:
app:
build:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion k8s-deployments/clean-architecture.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion k8s-deployments/redis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aa4c169

Please sign in to comment.