HSR-DeepThink commited on
Commit
e56355b
·
verified ·
1 Parent(s): 82734e4

Update docker/Dockerfile

Browse files
Files changed (1) hide show
  1. docker/Dockerfile +14 -17
docker/Dockerfile CHANGED
@@ -1,22 +1,19 @@
1
- ARG VARIANT
2
- FROM python:3$VARIANT
3
- LABEL org.opencontainers.image.authors="Lichess Bot Devs <lichess.bot.devs@gmail.com>"
4
- LABEL org.opencontainers.image.description="A bridge between Lichess API and chess engines"
5
- LABEL org.opencontainers.image.source="https://github.com/lichess-bot-devs/lichess-bot"
6
- LABEL org.opencontainers.image.documentation="https://github.com/lichess-bot-devs/lichess-bot/wiki/How-to-use-the-Docker-image"
7
- LABEL org.opencontainers.image.title="lichess-bot"
8
- LABEL org.opencontainers.image.licenses="AGPL-3.0-or-later"
9
 
10
- ENV LICHESS_BOT_DOCKER="true"
11
- ENV PYTHONDONTWRITEBYTECODE=1
 
 
 
12
 
13
- ARG LICHESS_DIR=/lichess-bot
14
- WORKDIR $LICHESS_DIR
15
 
16
- COPY . .
 
 
17
 
18
- RUN python3 -m pip install --no-cache-dir -r requirements.txt
 
19
 
20
- RUN chmod +x docker/copy_files.sh && ln -s $LICHESS_DIR/config/config.yml config.yml
21
-
22
- CMD docker/copy_files.sh && python3 lichess-bot.py ${OPTIONS} --disable_auto_logging
 
1
+ FROM python:3.10-slim
 
 
 
 
 
 
 
2
 
3
+ # Set up the strict Hugging Face user permissions
4
+ RUN useradd -m -u 1000 user
5
+ USER user
6
+ ENV HOME=/home/user \
7
+ PATH=/home/user/.local/bin:$PATH
8
 
9
+ WORKDIR $HOME/app
 
10
 
11
+ # Copy requirement parameters first
12
+ COPY --chown=user requirements.txt $HOME/app/requirements.txt
13
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
15
+ # Copy all repository code with user ownership permissions
16
+ COPY --chown=user . $HOME/app
17
 
18
+ # Start using our python server wrapper
19
+ CMD ["python", "app.py"]