Stockfish-e2 / Dockerfile
Ghostbot's picture
Upload 3 files
64f40d7 verified
Raw History Blame Contribute Delete
804 Bytes
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"]