File size: 797 Bytes
9fa42c1
d87ad37
cc7009d
d87ad37
622bb7a
d87ad37
 
622bb7a
d87ad37
 
622bb7a
 
 
9fa42c1
d87ad37
622bb7a
 
 
 
 
fdcfb8f
d87ad37
622bb7a
 
 
 
d87ad37
622bb7a
 
d87ad37
622bb7a
 
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
FROM python:3.11-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements and install Python packages
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt

# Verify streamlit is installed and accessible
RUN which streamlit
RUN streamlit --version

# Copy application code
COPY . .

# Create a non-root user (optional but recommended)
RUN useradd --create-home --shell /bin/bash appuser
RUN chown -R appuser:appuser /app
USER appuser

# Expose port
EXPOSE 7860

# Command to run the application
CMD ["python", "-m", "streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true"]