Supporto Docker/Unraid: build, healthcheck, docs
Aggiunti Dockerfile multi-stage, .dockerignore e docker-compose.yml per deployment containerizzato (con healthcheck, volumi persistenti, limiti risorse). Script di build per Linux/Mac e Windows. In Program.cs aggiunto endpoint /health e health checks per orchestrazione. Documentazione estesa: guide Unraid, quickstart Docker, workflow Git/DevOps, best practices su sicurezza, backup, monitoring. Progetto ora pronto per deploy e gestione professionale in ambienti Docker/Unraid.
This commit is contained in:
52
TradingBot/docker-compose.yml
Normal file
52
TradingBot/docker-compose.yml
Normal file
@@ -0,0 +1,52 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
tradingbot:
|
||||
container_name: tradingbot
|
||||
image: tradingbot:latest
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
# Persistenza dati applicazione
|
||||
- tradingbot-data:/app/data
|
||||
# Opzionale: mount locale per sviluppo
|
||||
# - ./logs:/app/logs
|
||||
environment:
|
||||
# Configurazioni applicazione
|
||||
- ASPNETCORE_ENVIRONMENT=Production
|
||||
- ASPNETCORE_URLS=http://+:8080
|
||||
# Fuso orario (importante per trading!)
|
||||
- TZ=Europe/Rome
|
||||
# Opzionali - Configurazioni avanzate
|
||||
# - TRADINGBOT__SimulationMode=true
|
||||
# - TRADINGBOT__AutoStartBot=true
|
||||
# - TRADINGBOT__UpdateIntervalSeconds=3
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
||||
interval: 30s
|
||||
timeout: 3s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
networks:
|
||||
- tradingbot-network
|
||||
# Resource limits (opzionali ma consigliati per Unraid)
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '2.0'
|
||||
memory: 1G
|
||||
reservations:
|
||||
cpus: '0.5'
|
||||
memory: 256M
|
||||
|
||||
volumes:
|
||||
tradingbot-data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
tradingbot-network:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user