euler314 commited on
Commit
4685a7b
·
verified ·
1 Parent(s): cf0f48c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -24
Dockerfile CHANGED
@@ -1,15 +1,12 @@
1
- # Use Python 3.9-slim as the base image.
2
- FROM python:3.9-slim
3
 
4
  # Disable .pyc file generation and force unbuffered stdout/stderr.
5
  ENV PYTHONDONTWRITEBYTECODE=1 \
6
  PYTHONUNBUFFERED=1
7
 
8
- # Tell Scrapely to disable its C extensions.
9
- ENV SCRAPELY_DISABLE_C_EXTENSIONS=1
10
-
11
  # Set the working directory.
12
- WORKDIR /home/user/app
13
 
14
  # Install system dependencies.
15
  RUN apt-get update && apt-get install -y --no-install-recommends \
@@ -24,30 +21,20 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
24
  && rm -rf /var/lib/apt/lists/* \
25
  && git lfs install
26
 
27
- # Upgrade pip and install some common packages.
28
- RUN pip install --upgrade pip && \
29
- pip install --no-cache-dir \
30
- datasets \
31
- "huggingface-hub>=0.19" \
32
- "hf-transfer>=0.1.4" \
33
- "protobuf<4" \
34
- "click<8.1" \
35
- "pydantic~=1.0"
36
-
37
- # Copy the requirements file.
38
- COPY requirements.txt .
39
 
40
- # First, install Scrapely in pure-Python mode (no binary wheels)
41
- RUN pip install --no-cache-dir --no-binary :all: scrapely==0.13.2
42
 
43
- # Then install the rest of the dependencies.
44
  RUN pip install --no-cache-dir -r requirements.txt
45
 
46
  # Copy the rest of your application code.
47
  COPY . .
48
 
49
- # Expose the port your app listens on (e.g. 8501 for Streamlit).
50
  EXPOSE 8501
51
 
52
- # Set the default command.
53
- CMD ["python", "app.py"]
 
1
+ # Use Python 3.10-slim as the base image.
2
+ FROM python:3.10-slim
3
 
4
  # Disable .pyc file generation and force unbuffered stdout/stderr.
5
  ENV PYTHONDONTWRITEBYTECODE=1 \
6
  PYTHONUNBUFFERED=1
7
 
 
 
 
8
  # Set the working directory.
9
+ WORKDIR /app
10
 
11
  # Install system dependencies.
12
  RUN apt-get update && apt-get install -y --no-install-recommends \
 
21
  && rm -rf /var/lib/apt/lists/* \
22
  && git lfs install
23
 
24
+ # Upgrade pip and install common packages.
25
+ RUN pip install --upgrade pip
 
 
 
 
 
 
 
 
 
 
26
 
27
+ # Copy requirements.txt into the container.
28
+ COPY requirements.txt .
29
 
30
+ # Install the Python dependencies.
31
  RUN pip install --no-cache-dir -r requirements.txt
32
 
33
  # Copy the rest of your application code.
34
  COPY . .
35
 
36
+ # Expose the port (Streamlit defaults to 8501).
37
  EXPOSE 8501
38
 
39
+ # Set the default command to run your Streamlit app.
40
+ CMD ["streamlit", "run", "app.py", "--server.port=8501"]