diff --git a/Dockerfile b/Dockerfile index e948fd4..00f02fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,8 +13,9 @@ WORKDIR /app ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 -COPY requirements.txt . -RUN pip install --no-cache-dir -r requirements.txt +COPY requirements.prod.txt . +RUN pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cpu torch==2.10.0 +RUN pip install --no-cache-dir -r requirements.prod.txt COPY game ./game COPY rl ./rl diff --git a/README.md b/README.md index a247234..b415b2e 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,9 @@ make setup pip install -r requirements.txt ``` +For deployment builds, the Dockerfile installs `requirements.prod.txt`, which +includes runtime dependencies (FastAPI + RL model) but omits local dev/test tools. + ## Run the dev servers Backend API (FastAPI + reload): diff --git a/requirements.prod.txt b/requirements.prod.txt new file mode 100644 index 0000000..45f905b --- /dev/null +++ b/requirements.prod.txt @@ -0,0 +1,6 @@ +fastapi==0.128.0 +gymnasium==1.2.3 +numpy==2.4.1 +sb3-contrib==2.7.1 +stable-baselines3==2.7.1 +uvicorn[standard]==0.40.0 diff --git a/server/session_store.py b/server/session_store.py index 9beac93..8d33d0b 100644 --- a/server/session_store.py +++ b/server/session_store.py @@ -11,6 +11,7 @@ from game.game import Game from game.game_state import GameState + class AIPlayerProtocol(Protocol): async def get_action(self, game_state: GameState, legal_actions: list) -> object: ... def get_action_sync(self, game_state: GameState, legal_actions: list) -> object: ...