Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +31 -0
Dockerfile
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use an official Python runtime as a parent image
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# Set the working directory in the container
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Install dependencies
|
8 |
+
RUN apt-get update && apt-get install -y \
|
9 |
+
wget \
|
10 |
+
&& rm -rf /var/lib/apt/lists/*
|
11 |
+
|
12 |
+
# Download the script from the Hugging Face URL
|
13 |
+
RUN wget https://huggingface.co/datasets/qdqd/Research-agent/resolve/main/app.py -O /app/app.py
|
14 |
+
|
15 |
+
# Check if the script was downloaded
|
16 |
+
RUN if [ ! -f /app/app.py ]; then echo "Error: app.py not found" && exit 1; fi
|
17 |
+
|
18 |
+
# Copy the requirements file into the container
|
19 |
+
COPY requirements.txt .
|
20 |
+
|
21 |
+
# Install Python dependencies
|
22 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
23 |
+
|
24 |
+
# Make port 7860 available to the world outside this container
|
25 |
+
EXPOSE 7860
|
26 |
+
|
27 |
+
# Define environment variable
|
28 |
+
ENV PYTHONUNBUFFERED=1
|
29 |
+
|
30 |
+
# Run the script when the container launches
|
31 |
+
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|