File size: 804 Bytes
df7e3c0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM python:3.11-slim

WORKDIR /app

# Install dependencies needed for python execution
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Download, extract, and install Stockfish using Python to bypass wget issues
RUN set -ex && \
    python -c "import urllib.request; urllib.request.urlretrieve('https://github.com/official-stockfish/Stockfish/releases/download/sf_18/stockfish-ubuntu-x86-64-avx2.tar', 'stockfish.tar')" && \
    tar -xf stockfish.tar && \
    STOCKFISH_BIN=$(find . -type f -name "*stockfish*x86-64*" -executable | head -n 1) && \
    mv "$STOCKFISH_BIN" /usr/local/bin/stockfish && \
    rm -rf stockfish.tar stockfish* && \
    chmod +x /usr/local/bin/stockfish

COPY app.py .

EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]