euler314 commited on
Commit
93867ed
·
verified ·
1 Parent(s): d422d23

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -19
Dockerfile CHANGED
@@ -1,11 +1,6 @@
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 \
@@ -13,34 +8,32 @@ RUN apt-get update && apt-get install -y \
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"]
 
1
+ FROM python:3.10-slim
 
2
 
3
+ WORKDIR /home/user/app
 
 
 
 
4
 
5
  # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
 
8
  cmake \
9
  git \
10
  libopencv-dev \
 
 
 
 
 
11
  libsm6 \
12
  libxext6 \
13
  libxrender-dev \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
  # Install Python dependencies
17
+ RUN pip install --no-cache-dir \
18
  streamlit \
19
  pillow \
20
  numpy
21
 
22
  # Copy the source files
23
+ COPY app.cpp /home/user/app/app.cpp
24
+ COPY app.py /home/user/app/app.py
25
 
26
  # Compile the C++ code
27
+ RUN g++ -o /home/user/app/eigen_analysis /home/user/app/app.cpp $(pkg-config --cflags --libs opencv4) -std=c++11
28
 
29
  # Create output directory
30
+ RUN mkdir -p /home/user/app/output && chmod 777 /home/user/app/output
31
+
32
+ # Set user permissions
33
+ RUN chmod -R 777 /home/user/app
34
 
35
  # Expose Streamlit port
36
+ EXPOSE 7860
37
 
38
  # Command to run the application
39
+ CMD ["streamlit", "run", "/home/user/app/app.py", "--server.port=7860", "--server.address=0.0.0.0"]