Enhance Docker and Compose configurations; add health check endpoint and caching improvements

- Updated Dockerfile to include FINN_CACHE_PATH and create data directory.
- Modified docker-compose.prod.yml to expose port 8010 and adjust resource limits.
- Updated docker-compose.yml to include FINN_CACHE_PATH and ensure proper port mapping.
- Added health check endpoint in http_server.py for container orchestration.
- Improved caching logic in analysis.py and service.py for similar units.
- Refined scoring.py with updated scoring model and constants for better accuracy.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Ole
2026-05-26 12:10:00 +00:00
parent d3f4bfa838
commit 46fd22c277
7 changed files with 315 additions and 233 deletions
+17 -13
View File
@@ -6,33 +6,33 @@ services:
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
# 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)"]
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:
@@ -42,16 +42,20 @@ services:
reservations:
cpus: '1'
memory: 512M
# Restart policy
restart: unless-stopped
# Logging configuration
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# For development, you can override with:
# docker-compose -f docker-compose.yml -f docker-compose.override.yml up
volumes:
- 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