eb95b98111
- Updated docker-compose files to use local data volumes for development. - Refactored analysis.py to improve code readability and performance, including changes to cache age calculations and hash computations. - Enhanced cache.py to ensure the database directory is created if it doesn't exist and improved SQL query formatting. - Modified cli.py to improve logging and statistics reporting for finn_ads. - Updated config.py to streamline environment variable handling. - Initialized the database eagerly in http_server.py to prevent runtime errors. - Refactored mcp_server.py to slim down data structures and improve response formatting for API calls. - Enhanced service.py to improve feedback handling and shortlist retrieval, ensuring enriched data is returned. - Updated recompute_analysis_cache.py for better SQL query formatting.
63 lines
1.4 KiB
YAML
63 lines
1.4 KiB
YAML
version: '3.9'
|
|
|
|
services:
|
|
mcp-server:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: finn-mcp-server
|
|
|
|
# Environment configuration
|
|
environment:
|
|
FINN_CACHE_PATH: /app/data/finn.sqlite
|
|
# MCP HTTP server configuration
|
|
MCP_HOST: 0.0.0.0
|
|
MCP_PORT: 8010
|
|
|
|
# Python configuration
|
|
PYTHONUNBUFFERED: 1
|
|
# Optional: FINN/Eiendom.no rate limiting and retry configuration
|
|
# FINN_RATE_LIMIT_DELAY: 0.5
|
|
# HTTP_TIMEOUT: 30
|
|
# HTTP_MAX_RETRIES: 3
|
|
|
|
# Port mapping for HTTP access
|
|
ports:
|
|
- "8010:8010"
|
|
|
|
# Health check
|
|
healthcheck:
|
|
test: [ "CMD", "python", "-c", "import requests; requests.get('http://localhost:8010/health', timeout=5)" ]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 10s
|
|
|
|
# Resource limits (adjust based on your server)
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: '2'
|
|
memory: 1G
|
|
reservations:
|
|
cpus: '1'
|
|
memory: 512M
|
|
|
|
# Restart policy
|
|
restart: unless-stopped
|
|
|
|
# Logging configuration
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
volumes:
|
|
- ./data:/app/data
|
|
# - finn-cache:/app/data
|
|
|
|
# volumes:
|
|
# finn-cache:
|
|
# For development, you can override with:
|
|
# docker-compose -f docker-compose.yml -f docker-compose.override.yml up
|