Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +12 -7
Dockerfile
CHANGED
@@ -2,21 +2,26 @@ FROM python:3.9-slim
|
|
2 |
|
3 |
WORKDIR /app
|
4 |
|
5 |
-
# Install system dependencies
|
6 |
RUN apt-get update && apt-get install -y \
|
7 |
build-essential \
|
|
|
8 |
python3-dev \
|
|
|
|
|
|
|
9 |
&& rm -rf /var/lib/apt/lists/*
|
10 |
|
11 |
-
# Copy
|
12 |
COPY requirements.txt .
|
13 |
-
|
|
|
14 |
|
15 |
-
#
|
16 |
-
|
17 |
|
18 |
-
# Compile the C++ module
|
19 |
-
RUN g++ -O3 -
|
20 |
$(python3-config --includes) \
|
21 |
-I$(python3 -c "import pybind11; print(pybind11.get_include())") \
|
22 |
-I$(python3 -c "import numpy; print(numpy.get_include())") \
|
|
|
2 |
|
3 |
WORKDIR /app
|
4 |
|
5 |
+
# Install system dependencies (all from your packages.txt)
|
6 |
RUN apt-get update && apt-get install -y \
|
7 |
build-essential \
|
8 |
+
cmake \
|
9 |
python3-dev \
|
10 |
+
libeigen3-dev \
|
11 |
+
python3-pybind11 \
|
12 |
+
pkg-config \
|
13 |
&& rm -rf /var/lib/apt/lists/*
|
14 |
|
15 |
+
# Copy all necessary files
|
16 |
COPY requirements.txt .
|
17 |
+
COPY cubic_cpp.cpp .
|
18 |
+
COPY app.py .
|
19 |
|
20 |
+
# Install Python dependencies
|
21 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
22 |
|
23 |
+
# Compile the C++ module with more robust error handling
|
24 |
+
RUN g++ -O3 -shared -std=c++11 -fPIC \
|
25 |
$(python3-config --includes) \
|
26 |
-I$(python3 -c "import pybind11; print(pybind11.get_include())") \
|
27 |
-I$(python3 -c "import numpy; print(numpy.get_include())") \
|