Hectozar commited on
Commit
03dab0c
·
verified ·
1 Parent(s): c327742

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -42
Dockerfile CHANGED
@@ -3,57 +3,23 @@ FROM python:3.11-slim
3
 
4
  # Step 2: Install required system utilities
5
  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: Copy repo files and explicitly grant ownership to our user
21
- COPY --chown=user:user . /app
22
-
23
- # --- AUTOMATED NNUE DOWNLOAD STEP ---
24
- # Creating the folder and downloading the latest networks for variants
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 6: Grant execute permission to your variant engine
46
- RUN chmod +x ./fairy/stockfish
47
-
48
- # Switch to the Hugging Face restricted user
49
- USER user
50
-
51
- # Step 7: Expose Hugging Face's mandatory port
52
  EXPOSE 7860
53
 
54
- # Force Python logs to output immediately
55
- ENV PYTHONUNBUFFERED=1
56
-
57
- # This creates a folder called 'www', puts an empty index file in it,
58
- # and tells the server to only show that folder.
59
- CMD mkdir -p www && touch www/index.html && python3 -m http.server 7860 --directory www & python3 lichess-bot-master/lichess-bot.py
 
3
 
4
  # Step 2: Install required system utilities
5
  RUN apt-get update && apt-get install -y \
 
 
6
  git \
 
7
  && rm -rf /var/lib/apt/lists/*
8
 
 
 
 
 
 
9
  # Step 3: Set up the working directory inside the container
10
  WORKDIR /app
11
 
12
+ # Step 4: Copy all your repository files into the container
13
+ COPY . /app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
+ # Step 5: Fix executable permissions ONLY for the stockfish binary
16
+ RUN chmod +x /app/fairy/stockfish
17
 
18
+ # Step 6: Install the Python requirements
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
+ # Step 7: Inform Hugging Face that we are opening port 7860
 
 
 
 
 
 
22
  EXPOSE 7860
23
 
24
+ # Step 8: Launch your environment
25
+ CMD python -m http.server 7860 & python lichess-bot-master/lichess-bot.py