File size: 1,433 Bytes
b7cd6ea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aadd69d
 
 
 
 
 
b7cd6ea
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ARG VARIANT
#FROM python:3$VARIANT
#LABEL org.opencontainers.image.authors="Lichess Bot Devs <lichess.bot.devs@gmail.com>"
#LABEL org.opencontainers.image.description="A bridge between Lichess API and chess engines"
#LABEL org.opencontainers.image.source="https://github.com/lichess-bot-devs/lichess-bot"
#LABEL org.opencontainers.image.documentation="https://github.com/lichess-bot-devs/lichess-bot/wiki/How-to-use-the-Docker-image"
#LABEL org.opencontainers.image.title="lichess-bot"
#LABEL org.opencontainers.image.licenses="AGPL-3.0-or-later"

#ENV LICHESS_BOT_DOCKER="true"
#ENV PYTHONDONTWRITEBYTECODE=1

#ARG LICHESS_DIR=/lichess-bot
#WORKDIR $LICHESS_DIR

#COPY . .

#RUN python3 -m pip install --no-cache-dir -r requirements.txt

#RUN chmod +x docker/copy_files.sh && ln -s $LICHESS_DIR/config/config.yml config.yml

#CMD docker/copy_files.sh && python3 lichess-bot.py ${OPTIONS} --disable_auto_logging

FROM python:3.10-slim

# Install system dependencies and stockfish engine binary
RUN apt-get update && apt-get install -y \
    stockfish \
    && rm -rf /lib/apt/lists/*

# Set up the exact Hugging Face user permissions
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/app

COPY --chown=user requirements.txt $HOME/app/requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt

COPY --chown=user . $HOME/app

CMD ["python", "app.py"]