Update Dockerfile
Browse files- Dockerfile +21 -40
Dockerfile
CHANGED
|
@@ -1,56 +1,37 @@
|
|
| 1 |
# Use Python 3.9-slim as the base image.
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
|
| 10 |
|
| 11 |
-
# Set the working directory.
|
| 12 |
WORKDIR /home/user/app
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 16 |
-
git \
|
| 17 |
-
git-lfs \
|
| 18 |
-
ffmpeg \
|
| 19 |
-
libsm6 \
|
| 20 |
-
libxext6 \
|
| 21 |
-
cmake \
|
| 22 |
-
rsync \
|
| 23 |
-
libgl1-mesa-glx \
|
| 24 |
-
&& rm -rf /var/lib/apt/lists/* \
|
| 25 |
-
&& git lfs install
|
| 26 |
-
|
| 27 |
-
# Upgrade pip and install common packages.
|
| 28 |
RUN pip install --upgrade pip && \
|
| 29 |
-
pip install --no-cache-dir
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
"pydantic~=1.0"
|
| 36 |
-
|
| 37 |
-
# Copy your requirements file.
|
| 38 |
COPY requirements.txt .
|
| 39 |
|
| 40 |
-
#
|
| 41 |
-
# Ensure your requirements.txt pins Scrapely to a compatible (or pure-Python) version.
|
| 42 |
-
# For example, include a line like:
|
| 43 |
-
#
|
| 44 |
-
# scrapely==0.13.2
|
| 45 |
-
#
|
| 46 |
-
# Then install your Python dependencies.
|
| 47 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 48 |
|
| 49 |
-
# Copy the rest of your application code
|
| 50 |
COPY . .
|
| 51 |
|
| 52 |
-
#
|
|
|
|
|
|
|
|
|
|
| 53 |
EXPOSE 8501
|
| 54 |
|
| 55 |
-
|
| 56 |
-
CMD ["python3", "app.py"]
|
|
|
|
| 1 |
# Use Python 3.9-slim as the base image.
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# Install system dependencies
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
git git-lfs ffmpeg libsm6 libxext6 cmake rsync libgl1-mesa-glx && \
|
| 7 |
+
rm -rf /var/lib/apt/lists/* && \
|
| 8 |
+
git lfs install
|
| 9 |
|
| 10 |
+
# Create a non-root user (if needed)
|
| 11 |
+
RUN useradd -m -u 1000 user
|
| 12 |
|
|
|
|
| 13 |
WORKDIR /home/user/app
|
| 14 |
|
| 15 |
+
# Upgrade pip and install common packages
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
RUN pip install --upgrade pip && \
|
| 17 |
+
pip install --no-cache-dir datasets "huggingface-hub>=0.19" "hf-transfer>=0.1.4" "protobuf<4" "click<8.1" "pydantic~=1.0"
|
| 18 |
+
|
| 19 |
+
# Set Playwright browsers path to local folder
|
| 20 |
+
ENV PLAYWRIGHT_BROWSERS_PATH=0
|
| 21 |
+
|
| 22 |
+
# Copy your requirements file
|
|
|
|
|
|
|
|
|
|
| 23 |
COPY requirements.txt .
|
| 24 |
|
| 25 |
+
# Install project dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 27 |
|
| 28 |
+
# Copy the rest of your application code
|
| 29 |
COPY . .
|
| 30 |
|
| 31 |
+
# Optionally, run playwright install (if your app depends on it)
|
| 32 |
+
RUN python -m playwright install chromium
|
| 33 |
+
|
| 34 |
+
# Expose the port your app uses (for example, 8501 for Streamlit)
|
| 35 |
EXPOSE 8501
|
| 36 |
|
| 37 |
+
CMD ["python", "app.py"]
|
|
|