# Use an official Python runtime as a parent image FROM python:3.9-slim # Set the working directory in the container WORKDIR /app # Install dependencies RUN apt-get update && apt-get install -y \ wget \ && rm -rf /var/lib/apt/lists/* # Download the script from the Hugging Face URL RUN wget https://huggingface.co/datasets/qdqd/Research-agent/resolve/main/app.py # Check if the script was downloaded RUN if [ ! -f /app/app.py ]; then echo "Error: app.py not found" && exit 1; fi # Copy the requirements file into the container COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Make port 7860 available to the world outside this container EXPOSE 7860 # Define environment variable ENV PYTHONUNBUFFERED=1 # Run the script when the container launches CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]