euler314 commited on
Commit
a7c450d
·
verified ·
1 Parent(s): 51e773e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +34 -6
Dockerfile CHANGED
@@ -1,18 +1,46 @@
1
- FROM python:3.10-slim
 
2
 
 
 
 
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  cmake \
8
- libeigen3-dev \
 
 
 
 
 
 
 
 
 
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- COPY requirements.txt .
12
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
 
 
 
 
13
 
14
- COPY app.py .
 
15
 
 
16
  EXPOSE 8501
17
 
18
- CMD ["streamlit", "run", "app.py", "--server.enableCORS=false", "--server.enableXsrfProtection=false"]
 
 
1
+ # Use Ubuntu as base image
2
+ FROM ubuntu:20.04
3
 
4
+ # Avoid prompts from apt
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
+
7
+ # Set work directory
8
  WORKDIR /app
9
 
10
+ # Install system dependencies
11
  RUN apt-get update && apt-get install -y \
12
  build-essential \
13
  cmake \
14
+ git \
15
+ libopencv-dev \
16
+ python3 \
17
+ python3-pip \
18
+ python3-dev \
19
+ python3-opencv \
20
+ wget \
21
+ libsm6 \
22
+ libxext6 \
23
+ libxrender-dev \
24
  && rm -rf /var/lib/apt/lists/*
25
 
26
+ # Install Python dependencies
27
+ RUN pip3 install --no-cache-dir \
28
+ streamlit \
29
+ pillow \
30
+ numpy
31
+
32
+ # Copy the source files
33
+ COPY app.cpp /app/app.cpp
34
+ COPY app.py /app/app.py
35
+
36
+ # Compile the C++ code
37
+ RUN g++ -o /app/eigen_analysis /app/app.cpp $(pkg-config --cflags --libs opencv4) -std=c++11
38
 
39
+ # Create output directory
40
+ RUN mkdir -p /app/output && chmod 777 /app/output
41
 
42
+ # Expose Streamlit port
43
  EXPOSE 8501
44
 
45
+ # Command to run the application
46
+ CMD ["streamlit", "run", "/app/app.py", "--server.address=0.0.0.0"]