Add configuration file and update server settings
- Introduced a new `config.yaml` file for managing server, database, cache, queue, AI, scraping, logging, and rate limiting configurations. - Updated `docker-compose.yml` to reflect the new server port (8081) and adjusted health check endpoints accordingly. - Modified `Dockerfile` to expose the new server port. - Updated `README.md` to reflect changes in server configuration and added documentation for the new configuration structure. - Added test scripts for server and Swagger documentation testing. - Refactored customer domain structure to align with new configuration settings and improve maintainability.
This commit is contained in:
+70
@@ -0,0 +1,70 @@
|
||||
server:
|
||||
host: "0.0.0.0"
|
||||
port: 8081
|
||||
timeout: 30s
|
||||
read_timeout: 10s
|
||||
write_timeout: 10s
|
||||
|
||||
database:
|
||||
mongodb:
|
||||
uri: "mongodb://localhost:27017"
|
||||
name: "tender_management"
|
||||
timeout: 10s
|
||||
max_pool_size: 100
|
||||
|
||||
cache:
|
||||
redis:
|
||||
host: "localhost"
|
||||
port: 6379
|
||||
password: ""
|
||||
db: 0
|
||||
pool_size: 10
|
||||
|
||||
queue:
|
||||
rabbitmq:
|
||||
url: "amqp://guest:guest@localhost:5672/"
|
||||
exchange: "tender_exchange"
|
||||
queues:
|
||||
scraping: "scraping_queue"
|
||||
processing: "processing_queue"
|
||||
notifications: "notifications_queue"
|
||||
|
||||
search:
|
||||
elasticsearch:
|
||||
urls: ["http://localhost:9200"]
|
||||
username: ""
|
||||
password: ""
|
||||
index_prefix: "tender_"
|
||||
|
||||
auth:
|
||||
jwt:
|
||||
secret: "your-super-secret-key"
|
||||
access_token_duration: "24h"
|
||||
refresh_token_duration: "168h" # 7 days
|
||||
|
||||
ai:
|
||||
openai:
|
||||
api_key: ""
|
||||
model: "gpt-3.5-turbo"
|
||||
max_tokens: 1000
|
||||
|
||||
scraping:
|
||||
user_agent: "TenderBot/1.0"
|
||||
timeout: 30s
|
||||
max_retries: 3
|
||||
delay_between_requests: 1s
|
||||
|
||||
logging:
|
||||
level: "info"
|
||||
format: "json"
|
||||
output: "file" # stdout, stderr, file
|
||||
file:
|
||||
path: "./logs/app.log"
|
||||
max_size: 100 # Max size in MB before rotation
|
||||
max_backups: 5 # Number of backup files to keep
|
||||
max_age: 30 # Max age in days to keep log files
|
||||
compress: true # Compress rotated files
|
||||
|
||||
rate_limiting:
|
||||
requests_per_minute: 100
|
||||
burst: 20
|
||||
Reference in New Issue
Block a user