Fix Docker

This commit is contained in:
Yûki VACHOT 2025-11-29 07:18:31 +01:00
parent 22d70a3bc0
commit 0666c07431
5 changed files with 26 additions and 46 deletions

View file

@ -8,12 +8,10 @@ __pycache__/
dist/
build/
*.egg
# Virtual environments
.venv/
venv/
env/
ENV/
.venv
# IDE
.vscode/
@ -27,11 +25,6 @@ ENV/
.gitignore
.gitattributes
# Documentation
*.md
!pyproject.toml
docs/
# Tests
tests/
.pytest_cache/
@ -45,11 +38,6 @@ htmlcov/
.gitlab-ci.yml
.travis.yml
# Environment
.env
.env.local
.env.*.local
# Logs
*.log
@ -57,14 +45,10 @@ htmlcov/
.DS_Store
Thumbs.db
# Docker
Dockerfile*
docker-compose*.yml
.dockerignore
# Local environment files (keep .env.example if it exists)
.env.local
.env.*.local
# Nginx
nginx/
# Data directories (will be mounted as volumes)
# Data directories (will be mounted as volumes in Docker)
data/
schemas/

View file

@ -17,14 +17,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
# Install uv for faster package installation
RUN pip install --no-cache-dir uv
# Copy only dependency files for better layer caching
COPY pyproject.toml .
# Copy only the files needed for dependency installation
COPY README.md pyproject.toml ./
# Install Python dependencies from pyproject.toml
RUN uv pip install --system --no-cache -e .
# Install Python dependencies
RUN uv pip install --system --no-cache .
# Copy application source code
COPY src/ ./src/
# Copy the rest of the application
COPY . .
# Create data directory for schema cache
RUN mkdir -p /app/data/schemas

View file

@ -1,5 +1,3 @@
version: '3.8'
# Production deployment with Nginx reverse proxy and SSL support
services:

View file

@ -1,15 +1,11 @@
version: '3.8'
services:
geoguessr-mcp:
# Option 1: Build locally
build:
context: .
dockerfile: Dockerfile
# Option 2: Use pre-built image from Docker Hub (uncomment to use)
# image: ${DOCKER_USERNAME:-yourusername}/geoguessr-mcp:${IMAGE_TAG:-latest}
container_name: geoguessr-mcp-server
restart: unless-stopped
ports:
@ -17,24 +13,21 @@ services:
environment:
# GeoGuessr Authentication (optional - can use login tool instead)
- GEOGUESSR_NCFA_COOKIE=${GEOGUESSR_NCFA_COOKIE:-}
# MCP Server configuration
- MCP_TRANSPORT=${MCP_TRANSPORT:-streamable-http}
- MCP_HOST=0.0.0.0
- MCP_PORT=8000
- MCP_HOST=${MCP_HOST:-0.0.0.0}
- MCP_PORT=${MCP_PORT:-8000} # Use the same variable as in ports
# Monitoring configuration
- MONITORING_ENABLED=${MONITORING_ENABLED:-true}
- MONITORING_INTERVAL_HOURS=${MONITORING_INTERVAL_HOURS:-24}
- SCHEMA_CACHE_DIR=/app/data/schemas
- SCHEMA_CACHE_DIR=${SCHEMA_CACHE_DIR:-/app/data/schemas}
# Logging
- LOG_LEVEL=${LOG_LEVEL:-INFO}
volumes:
# Persist schema cache between restarts
- geoguessr-schemas:/app/data/schemas
- geoguessr-schemas:${SCHEMA_CACHE_DIR:-/app/data/schemas}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
test: [ "CMD", "curl", "-f", "http://localhost:${MCP_PORT:-8000}/health" ]
interval: 30s
timeout: 10s
retries: 3
@ -44,11 +37,14 @@ services:
options:
max-size: "10m"
max-file: "3"
networks:
- geoguessr-mcp-network
volumes:
geoguessr-schemas:
name: geoguessr-mcp-schemas
networks:
default:
geoguessr-mcp-network:
name: geoguessr-mcp-network
driver: bridge

View file

@ -41,16 +41,18 @@ dev = [
"pre-commit>=3.6.0",
"debugpy>=1.8.0",
"ipython>=8.0.0",
"rich>=13.0.0"
"rich>=13.0.0",
"uv>=0.9.0",
"hatch>=1.10.0",
]
[project.scripts]
geoguessr-mcp = "server:main"
[project.urls]
Homepage = "https://github.com/yourusername/geoguessr-mcp"
Repository = "https://github.com/yourusername/geoguessr-mcp"
Issues = "https://github.com/yourusername/geoguessr-mcp/issues"
Homepage = "https://github.com/NyxiumYuuki/GeoGuessrMCP"
Repository = "https://github.com/NyxiumYuuki/GeoGuessrMCP"
Issues = "https://github.com/NyxiumYuuki/GeoGuessrMCP/issues"
[build-system]
requires = ["hatchling"]