Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +16 -41
Dockerfile
CHANGED
|
@@ -6,54 +6,29 @@ RUN apt-get update && apt-get install -y \
|
|
| 6 |
wget \
|
| 7 |
tar \
|
| 8 |
git \
|
| 9 |
-
curl \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
-
# --- HUGGING FACE COMPLIANCE STEP ---
|
| 13 |
-
RUN useradd -m -u 1000 user
|
| 14 |
-
ENV HOME=/home/user \
|
| 15 |
-
PATH=/home/user/.local/bin:$PATH
|
| 16 |
-
|
| 17 |
# Step 3: Set up the working directory inside the container
|
| 18 |
WORKDIR /app
|
| 19 |
|
| 20 |
-
# Step 4:
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
RUN mkdir -p /app/fairy/nnue && \
|
| 26 |
-
# Crazyhouse NNUE
|
| 27 |
-
curl -L -o /app/fairy/nnue/crazyhouse.nnue "https://raw.githubusercontent.com/fairy-stockfish/nnue-networks/main/crazyhouse-8ebf84784ad2.nnue" && \
|
| 28 |
-
# Atomic Chess NNUE
|
| 29 |
-
curl -L -o /app/fairy/nnue/atomic.nnue "https://raw.githubusercontent.com/fairy-stockfish/nnue-networks/main/active-41937adf950a.nnue" && \
|
| 30 |
-
# Three-check NNUE
|
| 31 |
-
curl -L -o /app/fairy/nnue/3check.nnue "https://raw.githubusercontent.com/fairy-stockfish/nnue-networks/main/3check-cb5f517c228b.nnue" && \
|
| 32 |
-
# King of the Hill NNUE
|
| 33 |
-
curl -L -o /app/fairy/nnue/koth.nnue "https://raw.githubusercontent.com/fairy-stockfish/nnue-networks/main/koth-a10c85f40398.nnue" && \
|
| 34 |
-
# Racing Kings NNUE
|
| 35 |
-
curl -L -o /app/fairy/nnue/racingkings.nnue "https://raw.githubusercontent.com/fairy-stockfish/nnue-networks/main/racingkings-608b26569108.nnue" && \
|
| 36 |
-
# Ensure the user owns the new NNUE files
|
| 37 |
-
chown -R user:user /app/fairy/nnue
|
| 38 |
-
|
| 39 |
-
# --- FIX: Permissions ---
|
| 40 |
-
RUN chmod -R 777 /app
|
| 41 |
-
|
| 42 |
-
# Step 5: Install the Python requirements
|
| 43 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 44 |
|
| 45 |
-
# Step
|
| 46 |
-
|
| 47 |
|
| 48 |
-
#
|
| 49 |
-
|
| 50 |
|
| 51 |
-
# Step
|
| 52 |
-
|
| 53 |
|
| 54 |
-
#
|
| 55 |
-
|
| 56 |
|
| 57 |
-
#
|
| 58 |
-
|
| 59 |
-
|
|
|
|
| 6 |
wget \
|
| 7 |
tar \
|
| 8 |
git \
|
|
|
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
# Step 3: Set up the working directory inside the container
|
| 12 |
WORKDIR /app
|
| 13 |
|
| 14 |
+
# Step 4: Download and extract Stockfish 18 safely
|
| 15 |
+
RUN mkdir -p engines && \
|
| 16 |
+
wget https://github.com/official-stockfish/Stockfish/releases/download/sf_18/stockfish-ubuntu-x86-64-avx2.tar && \
|
| 17 |
+
tar -xf stockfish-ubuntu-x86-64-avx2.tar -C engines && \
|
| 18 |
+
rm -rf stockfish-ubuntu-x86-64-avx2.tar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
+
# Step 5: Copy all your repository files into the container
|
| 21 |
+
COPY . /app
|
| 22 |
|
| 23 |
+
# Step 5.5: Fix permissions for the fairy stockfish engine
|
| 24 |
+
RUN chmod +x /app/fairy/stockfish
|
| 25 |
|
| 26 |
+
# Step 6: Install the Python requirements
|
| 27 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 28 |
|
| 29 |
+
# Step 6.5: Inform Hugging Face that we are opening port 7860
|
| 30 |
+
EXPOSE 7860
|
| 31 |
|
| 32 |
+
# Step 7: Start a dummy web server on port 7860 in the background, then launch your Lichess bot
|
| 33 |
+
CMD python -m http.server 7860 & python lichess-bot-master/lichess-bot.py
|
| 34 |
+
RUN chmod +x ./fairy/stockfish.py
|