Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +20 -21
Dockerfile
CHANGED
|
@@ -1,34 +1,33 @@
|
|
| 1 |
-
# Use
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
build-essential \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
# Hugging Face requires the container to run with UID 1000
|
| 18 |
RUN useradd -m -u 1000 user
|
| 19 |
USER user
|
| 20 |
-
ENV
|
| 21 |
-
PATH=/home/user/.local/bin:$PATH
|
| 22 |
|
| 23 |
-
|
|
|
|
|
|
|
| 24 |
COPY --chown=user requirements.txt .
|
| 25 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 26 |
|
| 27 |
-
#
|
| 28 |
-
|
| 29 |
|
| 30 |
-
#
|
| 31 |
-
|
| 32 |
|
| 33 |
-
#
|
| 34 |
CMD ["python", "bot.py"]
|
|
|
|
| 1 |
+
# Use Python 3.10
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# Install system dependencies for Playwright
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
libgbm-dev \
|
| 7 |
+
libnss3 \
|
| 8 |
+
libasound2 \
|
| 9 |
+
libxss1 \
|
| 10 |
+
libxtst6 \
|
| 11 |
+
fonts-liberation \
|
| 12 |
+
libgtk-3-0 \
|
|
|
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
+
# Set up user
|
|
|
|
| 16 |
RUN useradd -m -u 1000 user
|
| 17 |
USER user
|
| 18 |
+
ENV PATH="/home/user/.local/bin:${PATH}"
|
|
|
|
| 19 |
|
| 20 |
+
WORKDIR /app
|
| 21 |
+
|
| 22 |
+
# Copy requirements and install
|
| 23 |
COPY --chown=user requirements.txt .
|
| 24 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 25 |
|
| 26 |
+
# Install Playwright browsers
|
| 27 |
+
RUN playwright install chromium
|
| 28 |
|
| 29 |
+
# Copy the rest of the code
|
| 30 |
+
COPY --chown=user . .
|
| 31 |
|
| 32 |
+
# Run the bot
|
| 33 |
CMD ["python", "bot.py"]
|