0
0
mirror of https://github.com/alex289/CleanArchitecture.git synced 2025-08-22 19:28:34 +00:00

feat: Add rabbitmq to deployments

This commit is contained in:
alex289 2023-09-02 11:23:44 +02:00
parent bff6fb47f2
commit f44d36af02
No known key found for this signature in database
GPG Key ID: 573F77CD2D87F863
3 changed files with 66 additions and 1 deletions

View File

@ -49,6 +49,7 @@ 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 .`

View File

@ -15,6 +15,7 @@ services:
interval: 30s
timeout: 5s
retries: 3
db:
image: mcr.microsoft.com/mssql/server
environment:
@ -22,6 +23,7 @@ services:
- SA_PASSWORD=Password123!#
ports:
- 1433:1433
redis:
image: docker.io/bitnami/redis:7.2
environment:
@ -32,6 +34,19 @@ services:
- '6379:6379'
volumes:
- 'redis_data:/bitnami/redis/data'
rabbitmq:
image: "rabbitmq:3-management"
ports:
- "5672:5672"
- "15672:15672"
environment:
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
volumes:
- rabbitmq_data:/var/lib/rabbitmq
volumes:
rabbitmq_data:
redis_data:
driver: local

View File

@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: clean-architecture-app
# Replace this with the path to your built image
# Replace this with the path to your built image
image: alexdev28/clean-architecture
ports:
- containerPort: 80
@ -118,3 +118,52 @@ spec:
- protocol: TCP
port: 6379
targetPort: 6379
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: rabbitmq-deployment
spec:
replicas: 1
selector:
matchLabels:
app: rabbitmq
template:
metadata:
labels:
app: rabbitmq
spec:
containers:
- name: rabbitmq
image: rabbitmq:3-management
ports:
- containerPort: 5672
- containerPort: 15672
env:
- name: RABBITMQ_DEFAULT_USER
value: guest
- name: RABBITMQ_DEFAULT_PASS
value: guest
volumeMounts:
- name: rabbitmq-data
mountPath: /var/lib/rabbitmq
volumes:
- name: rabbitmq-data
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: rabbitmq-service
spec:
selector:
app: rabbitmq
ports:
- protocol: TCP
port: 5672
targetPort: 5672
- protocol: TCP
port: 15672
targetPort: 15672