Skip to content

Commit 34fd1c4

Browse files
committed
Refactor Docker infrastructure setup and update documentation
- Removed RabbitMQ and MongoDB configurations from docker-compose files. - Added new configurations for Redis, PostgreSQL, MySQL, Oracle, and other services. - Updated README and related documentation for local development instructions. - Introduced new Prometheus and ELK stack configurations. - Cleaned up obsolete files and improved overall structure.
1 parent 2a7fa41 commit 34fd1c4

22 files changed

+484
-163
lines changed

README.md

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,11 @@
4444
[twitterx-shield]: https://img.shields.io/twitter/url/https/twitter.com/genocs.svg?style=social
4545
[twitterx-url]: https://twitter.com/genocs
4646

47-
<p align="center">
48-
<img src="./assets/exagonal-architecture.png" alt="Exagonal Architecture">
49-
</p>
47+
[![Exagonal Architecture](https://raw.githubusercontent.com/Genocs/clean-architecture-template/main/assets/exagonal-architecture.png "Exagonal Architecture")](https://github.com/Genocs/clean-architecture-template)
5048

5149
# Genocs Clean Architecture Template
5250

53-
A comprehensive .NET 10 project template that follows Clean Architecture Principles and Domain-Driven Design (DDD). This template helps you rapidly scaffold microservices applications with built-in support for multiple databases, message brokers, and enterprise patterns.
51+
A comprehensive .NET 10 project template that follows Clean Architecture principles and Domain-Driven Design (DDD). This template helps you rapidly scaffold microservices applications with built-in support for multiple databases, message brokers, and enterprise patterns.
5452

5553
## ✨ Features
5654

@@ -178,43 +176,6 @@ dotnet new -u
178176
dotnet new list
179177
```
180178

181-
## 🔧 Development Workflow
182-
183-
### Local Development
184-
185-
```bash
186-
# Start infrastructure services
187-
docker-compose -f ./infrastructure/docker/docker-compose-infrastructure.yml up -d
188-
189-
# Run the API
190-
dotnet run --project src/WebApi/Host.csproj
191-
192-
# Run the Worker
193-
dotnet run --project src/Worker/Host.csproj
194-
195-
# Run all tests
196-
dotnet test
197-
198-
# Run specific test projects
199-
dotnet test src/UnitTests
200-
dotnet test src/IntegrationTests
201-
dotnet test src/AcceptanceTests
202-
203-
# Stop infrastructure services
204-
docker-compose -f ./infrastructure/docker/docker-compose-infrastructure.yml down
205-
206-
207-
# Build Docker WebApi image
208-
docker build -t genocs/clean-architecture-template -f ./src/WebApi/Dockerfile .
209-
210-
# Run Docker WebApi container
211-
docker run -d -p 8080:80 --name clean-architecture-template genocs/clean-architecture-template
212-
213-
# Stop and remove Docker WebApi container
214-
docker stop clean-architecture-template
215-
docker rm clean-architecture-template
216-
```
217-
218179
## 💬 Community & Support
219180

220181
### Get Help
@@ -233,7 +194,8 @@ docker rm clean-architecture-template
233194

234195
- ⭐ Star this repository
235196
- 🔄 Share with your team
236-
-[Buy me a coffee](https://www.buymeacoffee.com/genocs)
197+
198+
[![buy-me-a-coffee](https://raw.githubusercontent.com/Genocs/clean-architecture-template/main/assets/buy-me-a-coffee.png "buy me a coffee")](https://www.buymeacoffee.com/genocs)
237199

238200
## 🔧 Troubleshooting
239201

@@ -269,7 +231,7 @@ Become a financial contributor and help me sustain the project.
269231

270232
**Support the Project** on [Opencollective](https://opencollective.com/genocs)
271233

272-
<a href="https://opencollective.com/genocs"><img src="https://opencollective.com/genocs/individuals.svg?width=890"></a>
234+
[![Opencollective](https://opencollective.com/genocs/individuals.svg?width=890 "Opencollective")](https://opencollective.com/genocs)
273235

274236
## Acknowledgements
275237

src/Package.Template.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<Copyright>Copyright (c) 2026 Genocs Services</Copyright>
2020
<PackageReleaseNotes>
2121
Release notes:
22-
- Release 5.0.0:
22+
- Release 5.0.x
2323
- Updated to .NET 10
2424
- Improved Docker support
2525
- Added new templates for CQRS and Event Sourcing

src/README_NUGET.md

Lines changed: 55 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -135,33 +135,8 @@ src/
135135
- **Infrastructure Layer**: Repositories, message brokers, databases
136136
- **Presentation Layer**: Controllers, middleware, API documentation
137137

138-
## How to build and install the template locally
139138

140-
To build the package run the following commands:
141139

142-
```bash
143-
# To clone the repository
144-
git clone https://github.com/Genocs/clean-architecture-template
145-
cd clean-architecture-template
146-
147-
# To pack and install the template
148-
dotnet pack ./src/Package.Template.csproj -p:PackageVersion=5.0.0 --configuration Release --output ./out
149-
150-
dotnet new install ./out/Genocs.CleanArchitecture.Template.5.0.0.nupkg
151-
152-
# To verify the installation and see available options
153-
dotnet new cleanarchitecture --help
154-
155-
# To uninstall the template
156-
dotnet new uninstall Genocs.CleanArchitecture.Template
157-
158-
# Example of creating a new project with InMemory database and Rebus as service bus
159-
dotnet new cleanarchitecture --name {CompanyName.ServiceName} -da inmemory -sb rebus
160-
```
161-
162-
Official Documentation:
163-
- [custom-templates](https://docs.microsoft.com/en-us/dotnet/core/tools/custom-templates)
164-
- [dotnet-templating](https://github.com/dotnet/templating)
165140

166141

167142
### Miscellaneous
@@ -180,10 +155,53 @@ dotnet new list
180155

181156
### Local Development
182157

158+
In order to run the infrastructure components locally using Docker, follow these steps:
159+
> **NOTE**
160+
> 1. Make sure you have Docker installed and running on your machine.
161+
> 2. Adjust the `.env` file in the `./containers` folder to match your configuration needs (you can copy the `.env.example` file as a starting point).
162+
163+
183164
```bash
184-
# Start infrastructure services
185-
docker-compose -f ./infrastructure/docker/docker-compose-infrastructure.yml up -d
165+
cd ./containers
166+
167+
# Setup the infrastructure.
168+
# Use this file to setup the basic infrastructure components (RabbitMQ, MongoDB)
169+
docker compose -f ./infrastructure.yml --env-file ./.env --project-name genocs up -d
170+
171+
# Use this file only in case you want to setup Redis and PostgreSQL (no need if you use MongoDB)
172+
docker compose -f ./infrastructure-db.yml --env-file ./.env --project-name genocs up -d
173+
174+
# Use this file only in case you want to setup monitoring infrastructure components (Prometheus, Grafana, InfluxDB, Jaeger, Seq)
175+
docker compose -f ./infrastructure-monitoring.yml --env-file ./.env --project-name genocs up -d
176+
177+
# Use this file only in case you want to setup scaling infrastructure components (Fabio, Consul)
178+
docker compose -f ./infrastructure-scaling.yml --env-file ./.env --project-name genocs up -d
179+
180+
# Use this file only in case you want to setup security infrastructure components (Vault)
181+
docker compose -f ./infrastructure-security.yml --env-file ./.env --project-name genocs up -d
186182

183+
# Use this file only in case you want to setup sqlserver database (no need if you use PostgreSQL)
184+
docker compose -f ./infrastructure-sqlserver.yml --env-file ./.env --project-name genocs up -d
185+
186+
# Use this file only in case you want to setup mySql database (no need if you use PostgreSQL)
187+
docker compose -f ./infrastructure-mysql.yml --env-file ./.env --project-name genocs up -d
188+
189+
# Use this file only in case you want to setup oracle database (no need if you use PostgreSQL)
190+
docker compose -f ./infrastructure-oracle.yml --env-file ./.env --project-name genocs up -d
191+
192+
# Use this file only in case you want to setup elk stack
193+
docker compose -f ./infrastructure-elk.yml --env-file ./.env --project-name genocs up -d
194+
195+
# Use this file only in case you want to setup AI ML components prepared by Genocs
196+
docker compose -f ./infrastructure-ml.yml --env-file ./.env --project-name genocs up -d
197+
198+
cd ..
199+
```
200+
201+
202+
Running the application:
203+
204+
```bash
187205
# Run the API
188206
dotnet run --project src/WebApi/Host.csproj
189207

@@ -197,11 +215,11 @@ dotnet test
197215
dotnet test src/UnitTests
198216
dotnet test src/IntegrationTests
199217
dotnet test src/AcceptanceTests
218+
```
200219

201-
# Stop infrastructure services
202-
docker-compose -f ./infrastructure/docker/docker-compose-infrastructure.yml down
203-
220+
Building and Running with Docker:
204221

222+
```bash
205223
# Build Docker WebApi image
206224
docker build -t genocs/clean-architecture-template -f ./src/WebApi/Dockerfile .
207225

@@ -256,13 +274,19 @@ This project is licensed with the [MIT license](LICENSE).
256274
- Facebook Page [@genocs](https://facebook.com/Genocs)
257275
- Youtube Channel [@genocs](https://youtube.com/c/genocs)
258276

277+
## Code Contributors
278+
279+
This project exists thanks to all the people who contribute. [Submit your PR and join the team!](CONTRIBUTING.md)
280+
281+
[![genocs contributors](https://contrib.rocks/image?repo=Genocs/clean-architecture-template "genocs contributors")](https://github.com/Genocs/clean-architecture-template/graphs/contributors)
282+
259283
## Financial Contributors
260284

261285
Become a financial contributor and help me sustain the project.
262286

263287
**Support the Project** on [Opencollective](https://opencollective.com/genocs)
264288

265-
<a href="https://opencollective.com/genocs"><img src="https://opencollective.com/genocs/individuals.svg?width=890"></a>
289+
[![Opencollective](https://opencollective.com/genocs/individuals.svg?width=890 "Opencollective")](https://opencollective.com/genocs)
266290

267291
## Acknowledgements
268292

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# This file is a template for the .env file that is used by the docker-compose.yml file.
2+
POSTGRES_PASSWORD=<<POSTGRES_PASSWORD>>
3+
MSSQL_SA_PASSWORD=<<MSSQL_SA_PASSWORD>>
4+
ORACLE_PASSWORD=<<ORACLE_PASSWORD>>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
services:
2+
3+
redis:
4+
image: redis
5+
hostname: redis
6+
container_name: redis
7+
ports:
8+
- 6379:6379
9+
networks:
10+
- genocs
11+
# network_mode: host
12+
volumes:
13+
- redis:/data
14+
15+
postgres:
16+
image: postgres
17+
hostname: postgres
18+
container_name: postgres
19+
environment:
20+
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
21+
ports:
22+
- 5432:5432
23+
networks:
24+
- genocs
25+
# network_mode: host
26+
volumes:
27+
- postgres:/var/lib/postgresql/data
28+
29+
networks:
30+
genocs:
31+
name: genocs-network
32+
driver: bridge
33+
external: true
34+
35+
volumes:
36+
redis:
37+
driver: local
38+
postgres:
39+
driver: local
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
services:
2+
elasticsearch:
3+
image: docker.elastic.co/elasticsearch/elasticsearch:7.3.2
4+
hostname: elasticsearch
5+
container_name: elasticsearch
6+
environment:
7+
- cluster.name=docker-cluster
8+
- discovery.type=single-node
9+
- bootstrap.memory_lock=true
10+
- http.cors.enabled=true
11+
- http.cors.allow-origin=*
12+
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
13+
ulimits:
14+
memlock:
15+
soft: -1
16+
hard: -1
17+
volumes:
18+
- esdata:/usr/share/elasticsearch/data
19+
ports:
20+
- 9200:9200
21+
- 9300:9300
22+
networks:
23+
- genocs
24+
25+
kibana:
26+
image: docker.elastic.co/kibana/kibana:7.3.2
27+
hostname: kibana
28+
container_name: kibana
29+
environment:
30+
SERVER_NAME: kibana.local
31+
ELASTICSEARCH_URL: http://elasticsearch:9200
32+
ports:
33+
- 5601:5601
34+
networks:
35+
- genocs
36+
37+
headPlugin:
38+
image: 'mobz/elasticsearch-head:5'
39+
container_name: head
40+
ports:
41+
- 9100:9100
42+
networks:
43+
- genocs
44+
45+
logstash:
46+
image: docker.elastic.co/logstash/logstash
47+
hostname: logstash
48+
container_name: logstash
49+
secrets:
50+
- source: logstash.conf
51+
target: /usr/share/logstash/pipeline/logstash.conf
52+
- source: logstash.yml
53+
target: /usr/share/logstash/config/logstash.yml
54+
- source: logstash.keystore
55+
target: /usr/share/logstash/config/logstash.keystore
56+
- source: ca.crt
57+
target: /usr/share/logstash/config/certs/ca/ca.crt
58+
59+
healthcheck:
60+
test: bin/logstash -t
61+
interval: 60s
62+
timeout: 50s
63+
retries: 5
64+
networks:
65+
- genocs
66+
67+
networks:
68+
genocs:
69+
name: genocs-network
70+
external: true
71+
72+
volumes:
73+
esdata:
74+
driver: local
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
services:
2+
image_labeling:
3+
image: heartexlabs/label-studio:latest
4+
hostname: image_labeling
5+
container_name: image_labeling
6+
ports:
7+
- 8080:8080
8+
networks:
9+
- genocs
10+
11+
object_detection:
12+
image: genocs/object-detection-web:latest
13+
hostname: object_detection
14+
container_name: object_detection
15+
ports:
16+
- 5700:80
17+
networks:
18+
- genocs
19+
20+
networks:
21+
genocs:
22+
name: genocs-network
23+
external: true

0 commit comments

Comments
 (0)