euler314 commited on
Commit
9ccaa5c
·
verified ·
1 Parent(s): 782cad4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -16
Dockerfile CHANGED
@@ -1,15 +1,17 @@
1
- # Use Python 3.9-slim as base image
2
  FROM python:3.9-slim
3
 
4
- # Set environment variables
5
  ENV PYTHONDONTWRITEBYTECODE=1 \
6
- PYTHONUNBUFFERED=1 \
7
- SCRAPELY_DISABLE_C_EXTENSIONS=1
8
 
9
- # Set the working directory
 
 
 
10
  WORKDIR /home/user/app
11
 
12
- # Install system dependencies
13
  RUN apt-get update && apt-get install -y --no-install-recommends \
14
  git \
15
  git-lfs \
@@ -22,7 +24,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
22
  && rm -rf /var/lib/apt/lists/* \
23
  && git lfs install
24
 
25
- # Upgrade pip and install some global packages (adjust as needed)
26
  RUN pip install --upgrade pip && \
27
  pip install --no-cache-dir \
28
  datasets \
@@ -32,23 +34,23 @@ RUN pip install --upgrade pip && \
32
  "click<8.1" \
33
  "pydantic~=1.0"
34
 
35
- # Copy your requirements file into the container
36
  COPY requirements.txt .
37
 
38
- # In your requirements.txt, pin Scrapely to an older version (e.g. 0.13.2)
39
- # For example, your requirements.txt might include:
 
40
  #
41
  # scrapely==0.13.2
42
  #
43
- # Force a pure-Python install of Scrapely (skip binaries) and then install all packages:
44
- RUN pip install --no-cache-dir --no-binary=:all: scrapely==0.13.2 && \
45
- pip install --no-cache-dir -r requirements.txt
46
 
47
- # Copy the rest of your application code into the container
48
  COPY . .
49
 
50
- # Expose a port if your app runs a server (adjust as needed)
51
  EXPOSE 8501
52
 
53
- # Set the default command to run your application
54
  CMD ["python", "app.py"]
 
1
+ # Use Python 3.9-slim as the base image.
2
  FROM python:3.9-slim
3
 
4
+ # Disable .pyc generation and enable unbuffered stdout.
5
  ENV PYTHONDONTWRITEBYTECODE=1 \
6
+ PYTHONUNBUFFERED=1
 
7
 
8
+ # Tell Scrapely to disable its C extensions (if supported).
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 \
16
  git \
17
  git-lfs \
 
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
  datasets \
 
34
  "click<8.1" \
35
  "pydantic~=1.0"
36
 
37
+ # Copy your requirements file.
38
  COPY requirements.txt .
39
 
40
+ # IMPORTANT:
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
+ # If your app listens on a specific port (e.g. for Streamlit), expose that port.
53
  EXPOSE 8501
54
 
55
+ # Set the default command (adjust as needed).
56
  CMD ["python", "app.py"]