Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- Dockerfile +21 -7
Dockerfile
CHANGED
|
@@ -7,19 +7,33 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 7 |
gcc \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
|
| 13 |
-
# Install dependencies
|
| 14 |
RUN pip install --no-cache-dir \
|
| 15 |
-
chess>=1.10.0 \
|
| 16 |
fastapi>=0.100.0 \
|
| 17 |
-
uvicorn[standard]>=0.23.0 \
|
| 18 |
httpx>=0.24.0 \
|
| 19 |
pydantic>=2.0.0
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
# Expose port
|
| 25 |
EXPOSE 8000
|
|
|
|
| 7 |
gcc \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
+
# Install moonfish from PyPI (includes chess dependency)
|
| 11 |
+
RUN pip install --no-cache-dir moonfish
|
| 12 |
|
| 13 |
+
# Install additional dependencies for the RL server
|
| 14 |
RUN pip install --no-cache-dir \
|
|
|
|
| 15 |
fastapi>=0.100.0 \
|
| 16 |
+
"uvicorn[standard]>=0.23.0" \
|
| 17 |
httpx>=0.24.0 \
|
| 18 |
pydantic>=2.0.0
|
| 19 |
|
| 20 |
+
# Copy the RL module into the installed moonfish package
|
| 21 |
+
# First, find where moonfish is installed
|
| 22 |
+
RUN MOONFISH_PATH=$(python -c "import moonfish; import os; print(os.path.dirname(moonfish.__file__))") && \
|
| 23 |
+
mkdir -p ${MOONFISH_PATH}/rl/server
|
| 24 |
+
|
| 25 |
+
# Copy RL module files - we need to do this in a separate step
|
| 26 |
+
COPY __init__.py /tmp/rl/__init__.py
|
| 27 |
+
COPY models.py /tmp/rl/models.py
|
| 28 |
+
COPY client.py /tmp/rl/client.py
|
| 29 |
+
COPY server/__init__.py /tmp/rl/server/__init__.py
|
| 30 |
+
COPY server/app.py /tmp/rl/server/app.py
|
| 31 |
+
COPY server/chess_environment.py /tmp/rl/server/chess_environment.py
|
| 32 |
+
|
| 33 |
+
# Move files to moonfish package location
|
| 34 |
+
RUN MOONFISH_PATH=$(python -c "import moonfish; import os; print(os.path.dirname(moonfish.__file__))") && \
|
| 35 |
+
cp -r /tmp/rl/* ${MOONFISH_PATH}/rl/ && \
|
| 36 |
+
rm -rf /tmp/rl
|
| 37 |
|
| 38 |
# Expose port
|
| 39 |
EXPOSE 8000
|