File size: 907 Bytes
16acc09
 
 
 
 
 
 
 
 
 
 
 
1326d81
16acc09
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# 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"]