euler314 commited on
Commit
935b6de
·
verified ·
1 Parent(s): 709a4c6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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 requirements and install Python dependencies
12
  COPY requirements.txt .
13
- RUN pip install --no-cache-dir -r requirements.txt
 
14
 
15
- # Copy C++ source and app
16
- COPY cubic_cpp.cpp app.py ./
17
 
18
- # Compile the C++ module directly with optimizations
19
- RUN g++ -O3 -march=native -flto -ffast-math -Wall -shared -std=c++11 -fPIC \
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())") \