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

View file

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

View file

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

View file

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

View file

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