euler314 commited on
Commit
91471db
·
verified ·
1 Parent(s): 8e76ca4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -7
Dockerfile CHANGED
@@ -11,16 +11,26 @@ RUN apt-get update && apt-get install -y \
11
  python3-pybind11 \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # Copy and install requirements first (for better caching)
15
- COPY requirements.txt .
 
 
 
 
 
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
- # Copy C++ extension files and build them
19
- COPY cubic_cpp.cpp setup.py .
20
- RUN pip install -e .
21
 
22
- # Copy the rest of the application
23
- COPY . .
 
 
 
 
 
 
24
 
25
  # Run the application
26
  CMD ["streamlit", "run", "app.py"]
 
11
  python3-pybind11 \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Debug: List installed packages
15
+ RUN python -m pip list
16
+
17
+ # Copy all files at once to maintain relationships
18
+ COPY . .
19
+
20
+ # Install Python dependencies
21
  RUN pip install --no-cache-dir -r requirements.txt
22
 
23
+ # Build the C++ extension with verbose output
24
+ RUN python -m pip install -e . --verbose
 
25
 
26
+ # Verify the extension exists after building
27
+ RUN python -c "import os; print('Contents of directory:'); print(os.listdir('.')); \
28
+ print('Looking for .so files:'); print([f for f in os.listdir('.') if f.endswith('.so')]); \
29
+ print('Python path:'); import sys; print(sys.path)"
30
+
31
+ # Check if the module can be imported
32
+ RUN python -c "try: import cubic_cpp; print('✓ Successfully imported cubic_cpp'); \
33
+ except ImportError as e: print(f'✗ Import failed: {e}')"
34
 
35
  # Run the application
36
  CMD ["streamlit", "run", "app.py"]