euler314 commited on
Commit
9a06845
·
verified ·
1 Parent(s): 9264e00

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -6
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
@@ -11,14 +11,16 @@ RUN apt-get update && apt-get install -y \
11
  python3-pybind11 \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # Copy files
15
- COPY requirements.txt cubic_cpp.cpp setup.py app.py ./
16
-
17
- # Install Python requirements
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
- # Build the C++ extension
 
21
  RUN pip install -e .
22
 
 
 
 
23
  # Run the application
24
  CMD ["streamlit", "run", "app.py"]
 
1
+ FROM python:3.9
2
 
3
  WORKDIR /app
4
 
 
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"]