Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add two services #45

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,150 @@ curl -X GET --location "http://localhost:52323/trace?durationSeconds=15" \
متصل شده باشد نیازی به اضافه‌کردن فیلترهایی روی پردازش‌ها نیاز نیست و به صورت خودکار روی همان پردازش خاص
عملیات انجام می‌شود.

:::
:::

## کانفیگ چند نمونه‌ی dotnet-monitor برای سرویس‌های مختلف

برای مانیتور کردن چندین سرویس لازم است چندین نمونه
dotnet-monitor
ایجاد شود.

یک نمونه فایل داکر نوشته شده برای چندین سرویس به صورت زیر است.

```yaml
services:
redis:
image: redis:7.2-rc3-bookworm
container_name: star_redis
restart: unless-stopped
volumes:
- ./redis-data:/var/lib/redis
ports:
- "6379:6379"
command: [
"redis-server",
"--requirepass", "123",
"--appendonly", "yes",
"--maxmemory-policy", "allkeys-lru",
"--maxmemory", "4000mb",
"--save", "900", "1",
"--save", "300", "10",
"--save", "60", "10000",
]
healthcheck:
test: [ "CMD-SHELL", "redis-cli AUTH \"Redis@123\"", "redis-cli ping | grep PONG" ]
interval: 1s
timeout: 3s
retries: 5
networks:
- star_network

star_am:
image: repo.mohaymen.ir:3060/starrelease/am-29
container_name: AM
hostname: am
volumes:
- ./configs/AM/License.xml:/opt/MicroService.AccessManagement/output/License.xml
- ./configs/AM/configs:/opt/MicroService.AccessManagement/output/configs
- ./configs/AM/Logs:/opt/MicroService.AccessManagement/output/Logs:Z
- diagnostics-am:/home/star/:Z
- diagnosticsDump-am:/tmp
command: sh -c "dotnet MigrationFramework.dll AutoMigration && dotnet MSSE.AM.dll"
pull_policy: always
environment:
- DOTNET_DiagnosticPorts=/home/star/dotnet-monitor.sock,suspend
ports:
- 58081:58081
restart: unless-stopped
networks:
- star_network

star_web:
image: repo.mohaymen.ir:3060/starrelease/web-29
container_name: Web
hostname: web
volumes:
- ./configs/Web/nginx.conf:/etc/nginx/nginx.conf
- ./configs/Web/web.uiconfig:/opt/output/web.uiconfig
pull_policy: always
ports:
- 80:8080
networks:
- star_network
restart: unless-stopped

star_dia:
image: repo.mohaymen.ir:3060/starrelease/dia-29
container_name: DIA
hostname: dia
ports:
- 58088:58088
volumes:
- ./configs/DIA/License.xml:/opt/ETLEngine/output/License.xml:Z
- ./configs/DIA/configs:/opt/ETLEngine/output/configs:Z
- ./configs/DIA/Logs:/opt/ETLEngine/output/Logs:Z
- diagnostics-dia:/home/star/:Z
- diagnosticsDump-dia:/tmp
command: sh -c "dotnet MigrationFramework.dll AutoMigration && dotnet MSSE.DIA.dll"
pull_policy: always
environment:
- DOTNET_DiagnosticPorts=/home/star/dotnet-monitor.sock,suspend
restart: unless-stopped
depends_on:
star_am:
condition: service_started
networks:
- star_network

dotnet-monitor-am:
image: repo.mohaymen.ir:3060/utilities/dotnet-monitor:8
container_name: dotnet_monitor-am
user: 200000:200000
environment:
- DOTNETMONITOR_Authentication__MonitorApiKey__Subject=fc9cfcfd-dc94-4dd1-8525-43d7d9399f70
- DOTNETMONITOR_Authentication__MonitorApiKey__PublicKey=eyJjcnYiOiJQLTM4NCIsImtleV9vcHMiOltdLCJrdHkiOiJFQyIsIm90aCI6W10sIngiOiJsU3AzTnpUMzludkRoS1ktVFpRTy1KTm5ZSUZ6LUEtUnRxVU1tajM2NkZiWG5zLVgyOVN1ZHphMjJIbVBBU2p2IiwieDVjIjpbXSwieSI6IkI3NFhNUVFaalpoVGpXdnFZZHhvOEtTV0hTT3EzUXdKYVk1WWZFS3NxU0dlZTF4WlFadlFBUExPTjZLU1hTVHAifQ
- DOTNETMONITOR_Urls=http://+:52323
- DOTNETMONITOR_DiagnosticPort__ConnectionMode=Listen
- DOTNETMONITOR_Storage__DefaultSharedPath=/diagnostics
- DOTNETMONITOR_Storage__DumpTempFolder=/tmp
ports:
- 52323:52323
volumes:
- diagnostics-am:/diagnostics
- diagnosticsDump-am:/tmp
restart: no
networks:
- star_network

dotnet-monitor-dia:
image: repo.mohaymen.ir:3060/utilities/dotnet-monitor:8
container_name: dotnet_monitor-dia
user: 200000:200000
environment:
- DOTNETMONITOR_Authentication__MonitorApiKey__Subject=fc9cfcfd-dc94-4dd1-8525-43d7d9399f70
- DOTNETMONITOR_Authentication__MonitorApiKey__PublicKey=eyJjcnYiOiJQLTM4NCIsImtleV9vcHMiOltdLCJrdHkiOiJFQyIsIm90aCI6W10sIngiOiJsU3AzTnpUMzludkRoS1ktVFpRTy1KTm5ZSUZ6LUEtUnRxVU1tajM2NkZiWG5zLVgyOVN1ZHphMjJIbVBBU2p2IiwieDVjIjpbXSwieSI6IkI3NFhNUVFaalpoVGpXdnFZZHhvOEtTV0hTT3EzUXdKYVk1WWZFS3NxU0dlZTF4WlFadlFBUExPTjZLU1hTVHAifQ
- DOTNETMONITOR_Urls=http://+:52323
- DOTNETMONITOR_DiagnosticPort__ConnectionMode=Listen
- DOTNETMONITOR_Storage__DefaultSharedPath=/diagnostics
- DOTNETMONITOR_Storage__DumpTempFolder=/tmp
ports:
- 52324:52323
volumes:
- diagnostics-dia:/diagnostics
- diagnosticsDump-dia:/tmp
restart: no
networks:
- star_network


networks:
star_network:
driver: bridge


volumes:
diagnostics-dia: { }
diagnosticsDump-dia: { }
diagnostics-am: { }
diagnosticsDump-am: { }
```