Init Commit

This commit is contained in:
Yûki VACHOT 2025-11-28 19:24:17 +01:00
commit ce5abcc217
19 changed files with 2526 additions and 0 deletions

View file

@ -0,0 +1,53 @@
# Development Dockerfile for GeoGuessr MCP Server
FROM python:3.13-slim
# Prevent Python from writing pyc files and buffering stdout/stderr
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
git \
ssh \
sudo \
vim \
nano \
htop \
procps \
net-tools \
iputils-ping \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user for development
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
# Install uv for fast package management
RUN pip install --no-cache-dir uv
# Set up workspace
WORKDIR /workspace
# Copy pyproject.toml and poetry.lock (or similar) first for layer caching
COPY pyproject.toml README.md ./
# Install project and dev dependencies using uv
RUN uv pip install --system --no-cache --upgrade pip && \
uv pip install --system --no-cache -e ".[dev]"
COPY . .
# Switch to non-root user
USER $USERNAME
# Set Python path
ENV PYTHONPATH=/workspace
# Default command
CMD ["sleep", "infinity"]

View file

@ -0,0 +1,56 @@
{
"name": "GeoGuessr MCP Server Dev",
"dockerComposeFile": "docker-compose.dev.yml",
"service": "dev",
"workspaceFolder": "/workspace",
// Features to install
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {}
},
// Configure tool-specific properties
"customizations": {
// VS Code settings (also works for some PyCharm features)
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.black-formatter",
"charliermarsh.ruff",
"tamasfe.even-better-toml",
"redhat.vscode-yaml"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.formatting.provider": "black",
"python.linting.enabled": true,
"python.linting.ruffEnabled": true
}
}
},
// Ports to forward
"forwardPorts": [8000],
// Environment variables
"containerEnv": {
"PYTHONDONTWRITEBYTECODE": "1",
"PYTHONUNBUFFERED": "1"
},
// Run commands after container is created
"postCreateCommand": "pip install -e '.[dev]' && pre-commit install || true",
// Run commands when container starts
"postStartCommand": "echo 'Dev container ready! Run: python src/server.py'",
// Mount the .env file if it exists
"mounts": [
"source=${localWorkspaceFolder}/.env,target=/workspace/.env,type=bind,consistency=cached"
],
// User configuration
"remoteUser": "vscode"
}

View file

@ -0,0 +1,46 @@
version: '3.8'
services:
dev:
build:
context: ..
dockerfile: .devcontainer/Dockerfile.dev
volumes:
# Mount the workspace
- ..:/workspace:cached
# Persist VS Code extensions
- vscode-extensions:/home/vscode/.vscode-server/extensions
# Persist pip cache
- pip-cache:/home/vscode/.cache/pip
# Docker socket for Docker-in-Docker (optional)
# - /var/run/docker.sock:/var/run/docker.sock
# Keep container running
command: sleep infinity
# Environment
environment:
- PYTHONDONTWRITEBYTECODE=1
- PYTHONUNBUFFERED=1
# Load from .env file
- GEOGUESSR_NCFA_COOKIE=${GEOGUESSR_NCFA_COOKIE:-}
- MCP_TRANSPORT=streamable-http
- MCP_HOST=0.0.0.0
- MCP_PORT=8000
# Ports
ports:
- "8000:8000"
- "5678:5678" # debugpy port
# Network
networks:
- dev-network
volumes:
vscode-extensions:
pip-cache:
networks:
dev-network:
name: geoguessr-mcp-dev