mednow commited on
Commit
3a53ca6
1 Parent(s): ab1ad17

Upload 3 files

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -7
Dockerfile CHANGED
@@ -1,8 +1,10 @@
 
1
  FROM python:3.8-slim
2
 
3
  # Set the working directory
4
  WORKDIR /app
5
 
 
6
  RUN apt-get update && \
7
  apt-get install -y \
8
  libgl1-mesa-glx \
@@ -12,20 +14,20 @@ RUN apt-get update && \
12
  # Copy the requirements file
13
  COPY requirements.txt .
14
 
15
- # Install dependencies
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
  # Copy the rest of the application
19
  COPY . .
20
 
21
- # Expose the port the app runs on
22
- EXPOSE 5000
23
 
24
- # Create the uploads, flagged, and matplotlib_cache directories with proper permissions
25
- RUN mkdir -p /app/flagged /app/matplotlib_cache && chmod -R 777 /app/uploads /app/flagged /app/matplotlib_cache
26
 
27
  # Set the MPLCONFIGDIR environment variable
28
  ENV MPLCONFIGDIR=/app/matplotlib_cache
29
 
30
- # Run the application
31
- CMD ["streamlit", "run", "app.py"]
 
1
+ # Use Python 3.8 slim image
2
  FROM python:3.8-slim
3
 
4
  # Set the working directory
5
  WORKDIR /app
6
 
7
+ # Install system dependencies for OpenCV and other tools
8
  RUN apt-get update && \
9
  apt-get install -y \
10
  libgl1-mesa-glx \
 
14
  # Copy the requirements file
15
  COPY requirements.txt .
16
 
17
+ # Install Python dependencies
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
  # Copy the rest of the application
21
  COPY . .
22
 
23
+ # Expose the port that Streamlit runs on (default: 8501)
24
+ EXPOSE 8501
25
 
26
+ # Create necessary directories with proper permissions
27
+ RUN mkdir -p /app/flagged /app/matplotlib_cache && chmod -R 777 /app/uploads /app/flagged /app/matplotlib_cache
28
 
29
  # Set the MPLCONFIGDIR environment variable
30
  ENV MPLCONFIGDIR=/app/matplotlib_cache
31
 
32
+ # Run the application on the correct port and address
33
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]