Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -6
Dockerfile
CHANGED
|
@@ -1,14 +1,21 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
# Install Stockfish as root
|
| 4 |
RUN apt-get update && apt-get install -y stockfish curl && rm -rf /var/lib/apt/lists/*
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
RUN pip install --no-cache-dir flask gunicorn chess
|
| 9 |
|
| 10 |
-
#
|
| 11 |
RUN chmod +x setup.sh
|
| 12 |
-
|
| 13 |
-
# Set the entrypoint
|
| 14 |
CMD ["./setup.sh"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Install Stockfish as root
|
| 4 |
RUN apt-get update && apt-get install -y stockfish curl && rm -rf /var/lib/apt/lists/*
|
| 5 |
|
| 6 |
+
# Create a non-root user and set up the working directory
|
| 7 |
+
RUN useradd -m -u 1000 user
|
| 8 |
+
USER user
|
| 9 |
+
ENV HOME=/home/user \
|
| 10 |
+
PATH=/home/user/.local/bin:/usr/games:$PATH
|
| 11 |
+
|
| 12 |
+
WORKDIR $HOME/app
|
| 13 |
+
|
| 14 |
+
# Copy files and ensure the 'user' owns them
|
| 15 |
+
COPY --chown=user . .
|
| 16 |
+
|
| 17 |
RUN pip install --no-cache-dir flask gunicorn chess
|
| 18 |
|
| 19 |
+
# Explicitly find and export Stockfish path
|
| 20 |
RUN chmod +x setup.sh
|
|
|
|
|
|
|
| 21 |
CMD ["./setup.sh"]
|