File size: 922 Bytes
541454c
09d09d3
7086216
541454c
 
 
 
 
49fee0b
541454c
 
 
 
7086216
1302d08
541454c
09d09d3
 
541454c
 
 
 
 
 
 
 
 
 
 
 
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
# Use the official Python 3.10 slim image as the base
FROM python:3.10-slim

# Set environment variables to ensure consistent behavior
ENV PYTHONUNBUFFERED=1 \
    STREAMLIT_BROWSER_GATHER_USAGE_STATS=false \
    STREAMLIT_SERVER_HEADLESS=true \
    STREAMLIT_HOME=/tmp/.streamlit

# Create the .streamlit directory with appropriate permissions
RUN mkdir -p $STREAMLIT_HOME && chmod -R 755 $STREAMLIT_HOME

# Set the working directory in the container
WORKDIR /app

# Copy only the requirements file first to leverage Docker cache
COPY requirements.txt .

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

# Copy the rest of the application code
COPY . .

# Expose the port Streamlit will run on
EXPOSE 8501

# Define the command to run the Streamlit app
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]