File size: 1,140 Bytes
aebe25e
 
e8981aa
aebe25e
e8981aa
 
aebe25e
 
e8981aa
 
 
 
 
 
aebe25e
 
e8981aa
aebe25e
e8981aa
aebe25e
 
 
e8981aa
aebe25e
e8981aa
 
aebe25e
 
 
 
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
# Use a slim official Python image as the base
FROM python:3.10-slim

# Set the working directory inside the container
WORKDIR /app

# Install system dependencies needed for some Python packages (like 'build-essential' for compiling)
# This step is often necessary to avoid errors during pip install
RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    git \
    && rm -rf /var/lib/apt/lists/*

# Copy the requirements file and install Python dependencies
# This is done before copying the app code to leverage Docker layer caching
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

# Copy the entire application code into the container
# Assuming your Streamlit file is named 'streamlit_app.py' in the root
COPY . /app

# Expose the default Streamlit port
EXPOSE 8501

# The ENTRYPOINT command that runs the Streamlit app when the container starts
# --server.port=8501: Sets the port Streamlit listens on
# --server.address=0.0.0.0: Makes the app accessible from outside the container
ENTRYPOINT ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]