File size: 954 Bytes
3a53ca6
ab1ad17
 
 
 
 
3a53ca6
ab1ad17
 
 
 
 
 
 
 
 
3a53ca6
ab1ad17
 
 
 
 
3a53ca6
 
ab1ad17
3a53ca6
 
ab1ad17
 
 
 
3a53ca6
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Use Python 3.8 slim image
FROM python:3.8-slim

# Set the working directory
WORKDIR /app

# Install system dependencies for OpenCV and other tools
RUN apt-get update && \

    apt-get install -y \
    libgl1-mesa-glx \
    libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*
    
# Copy the requirements file
COPY requirements.txt .

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application
COPY . .

# Expose the port that Streamlit runs on (default: 8501)
EXPOSE 8501

# Create necessary directories with proper permissions
RUN mkdir -p /app/flagged /app/matplotlib_cache && chmod -R 777 /app/uploads /app/flagged /app/matplotlib_cache

# Set the MPLCONFIGDIR environment variable
ENV MPLCONFIGDIR=/app/matplotlib_cache

# Run the application on the correct port and address
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]