Spaces:
Sleeping
Sleeping
FROM python:3.9 | |
WORKDIR /code | |
# Install system dependencies | |
RUN apt-get update && apt-get install -y \ | |
build-essential \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Create necessary directories | |
RUN mkdir -p /code/templates | |
# Copy requirements first to leverage Docker cache | |
COPY ./requirements.txt /code/requirements.txt | |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
# Copy all Python files | |
COPY ./*.py /code/ | |
COPY ./templates /code/templates | |
# Make port 7860 available to the world outside this container | |
EXPOSE 7860 | |
# Note: The PATENTSVIEW_API_KEY environment variable must be set when running the container | |
# Example: docker run -e PATENTSVIEW_API_KEY=your_api_key_here ... | |
# Run gunicorn with the run.py application | |
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "run:app", "--timeout", "300"] |