Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +15 -6
Dockerfile
CHANGED
@@ -24,7 +24,13 @@ RUN apt-get update && \
|
|
24 |
libedit-dev \
|
25 |
libffi-dev \
|
26 |
# Python dev headers, often needed for compiling Python extensions
|
27 |
-
python3-dev
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
rm -rf /var/lib/apt/lists/*
|
29 |
|
30 |
# Set LLVM_CONFIG environment variable *before* installing numba/llvmlite
|
@@ -39,18 +45,21 @@ RUN pip install --no-cache-dir numpy==1.22.4
|
|
39 |
# REMOVED: && python -m spacy download en_core_web_sm
|
40 |
RUN pip install --no-cache-dir -r requirements.txt
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
# Create necessary directories with appropriate permissions
|
43 |
RUN mkdir -p /app/cache /app/uploads /app/results /app/checkpoints /app/temp \
|
44 |
&& chmod -R 777 /app/cache /app/uploads /app/results /app/checkpoints /app/temp
|
45 |
|
46 |
# Ensure all relevant directories have the correct permissions (redundant for /app itself if contents are copied later)
|
|
|
47 |
RUN chmod -R 777 /app
|
48 |
|
49 |
-
#
|
50 |
-
# This should be done AFTER all dependencies are installed
|
51 |
-
COPY . /app/
|
52 |
-
|
53 |
-
# Disable Numba's on-disk caching (often problematic in containers)
|
54 |
ENV NUMBA_DISABLE_PER_FILE_CACHE=1
|
55 |
|
56 |
# Expose the port the app runs on
|
|
|
24 |
libedit-dev \
|
25 |
libffi-dev \
|
26 |
# Python dev headers, often needed for compiling Python extensions
|
27 |
+
python3-dev \
|
28 |
+
# --- NEW: Install OpenCV dependencies for graphical libraries ---
|
29 |
+
libgl1-mesa-glx \
|
30 |
+
libsm6 \
|
31 |
+
libxrender1 \
|
32 |
+
# --- End NEW ---
|
33 |
+
&& \
|
34 |
rm -rf /var/lib/apt/lists/*
|
35 |
|
36 |
# Set LLVM_CONFIG environment variable *before* installing numba/llvmlite
|
|
|
45 |
# REMOVED: && python -m spacy download en_core_web_sm
|
46 |
RUN pip install --no-cache-dir -r requirements.txt
|
47 |
|
48 |
+
# --- NEW: Move COPY . /app/ here, after all apt-get and pip installs ---
|
49 |
+
# Copy the rest of the application code to /app
|
50 |
+
# This should be done AFTER all dependencies are installed
|
51 |
+
COPY . /app/
|
52 |
+
# --- End NEW ---
|
53 |
+
|
54 |
# Create necessary directories with appropriate permissions
|
55 |
RUN mkdir -p /app/cache /app/uploads /app/results /app/checkpoints /app/temp \
|
56 |
&& chmod -R 777 /app/cache /app/uploads /app/results /app/checkpoints /app/temp
|
57 |
|
58 |
# Ensure all relevant directories have the correct permissions (redundant for /app itself if contents are copied later)
|
59 |
+
# This line is now effectively ensuring any newly created files/directories *after* the initial copy also have permissions.
|
60 |
RUN chmod -R 777 /app
|
61 |
|
62 |
+
# Disable Numba's on-disk caching (often problematic in containers) - already present but keeping it for clarity
|
|
|
|
|
|
|
|
|
63 |
ENV NUMBA_DISABLE_PER_FILE_CACHE=1
|
64 |
|
65 |
# Expose the port the app runs on
|