Spaces:
Sleeping
Sleeping
Update docker/Dockerfile
Browse files- docker/Dockerfile +14 -17
docker/Dockerfile
CHANGED
|
@@ -1,22 +1,19 @@
|
|
| 1 |
-
|
| 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 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
-
|
| 14 |
-
WORKDIR $LICHESS_DIR
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
|
|
|
| 19 |
|
| 20 |
-
|
| 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"]
|
|
|