File size: 853 Bytes
038f39f
 
 
 
 
 
 
 
 
 
 
 
0d735be
 
038f39f
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use an official Python runtime as the base image
FROM python:3.9-slim

# Set the working directory inside the container
WORKDIR /app

# Install system dependencies (e.g., for feedparser and Flask)
RUN apt-get update && apt-get install -y \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Download app.py and requirements.txt from Hugging Face dataset URLs
RUN curl -L -o app.py "https://huggingface.co/dwfwfwfwf/news-api-2.0/resolve/main/app.py" 
RUN curl -L -o requirements.txt "https://huggingface.co/datasets/dwfwfwfwf/NEWS-API/resolve/main/requirements.txt"

# Install Python dependencies from requirements.txt
RUN pip install --no-cache-dir -r requirements.txt


EXPOSE 7860

# Set environment variables for Flask
ENV FLASK_APP=app.py
ENV FLASK_ENV=production

# Command to run the Flask app
CMD ["flask", "run", "--host=0.0.0.0", "--port=7860"]