File size: 887 Bytes
bfe88a9
eba3628
bfe88a9
 
 
 
 
 
 
 
 
 
 
3222a21
bfe88a9
3222a21
bfe88a9
3222a21
bfe88a9
 
3222a21
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Use an official Python runtime as a parent image
FROM python:3.12-slim

# Set the working directory in the container
WORKDIR /code

# Copy the requirements file into the container
COPY ./requirements.txt /code/requirements.txt

# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# Copy the application code (Backend API and Streamlit app)
COPY ./app /code/app
COPY ./streamlit_app.py /code/streamlit_app.py # Add streamlit app file

# Make port 7860 available (Streamlit default is 8501, but HF uses specified port)
EXPOSE 7860

# Command to run the Streamlit application
# Use --server.port to match EXPOSE and HF config
# Use --server.address to bind correctly inside container
CMD ["streamlit", "run", "streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]