PhyllisPeh commited on
Commit
94d94b6
·
1 Parent(s): ac9c5bb

fixed detection of innovation gaps and inconsistency between runs

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -31
Dockerfile CHANGED
@@ -7,45 +7,24 @@ RUN apt-get update && apt-get install -y \
7
  build-essential \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- # Create necessary directories and set permissions
11
- RUN mkdir -p /code/templates && \
12
- mkdir -p /tmp/numba_cache && \
13
- mkdir -p /tmp/patent_cache && \
14
- chmod -R 777 /tmp/numba_cache && \
15
- chmod -R 777 /tmp/patent_cache && \
16
- chmod 777 /tmp
17
-
18
- # Set Numba environment variables
19
- ENV NUMBA_DISABLE_JIT=1
20
- ENV NUMBA_CACHE_DIR=/tmp/numba_cache
21
- ENV NUMBA_DISABLE_PERFORMANCE_WARNINGS=1
22
 
23
  # Copy requirements first to leverage Docker cache
24
  COPY ./requirements.txt /code/requirements.txt
25
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
26
 
27
- # Copy all Python files
28
- COPY ./*.py /code/
29
  COPY ./templates /code/templates
30
 
31
  # Make port 7860 available to the world outside this container
32
  EXPOSE 7860
33
 
34
- # Create a wrapper script to check environment variables
35
- RUN echo '#!/bin/bash\n\
36
- if [ -z "$SERPAPI_API_KEY" ]; then\n\
37
- echo "Error: SERPAPI_API_KEY environment variable is not set"\n\
38
- exit 1\n\
39
- fi\n\
40
- if [ -z "$OPENAI_API_KEY" ]; then\n\
41
- echo "Error: OPENAI_API_KEY environment variable is not set"\n\
42
- exit 1\n\
43
- fi\n\
44
- exec "$@"' > /code/entrypoint.sh && \
45
- chmod +x /code/entrypoint.sh
46
-
47
- # Use the wrapper script as the entrypoint
48
- ENTRYPOINT ["/code/entrypoint.sh"]
49
-
50
- # Run gunicorn with app.py directly
51
  CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app", "--timeout", "300"]
 
7
  build-essential \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
+ # Create necessary directories
11
+ RUN mkdir -p /code/templates
 
 
 
 
 
 
 
 
 
 
12
 
13
  # Copy requirements first to leverage Docker cache
14
  COPY ./requirements.txt /code/requirements.txt
15
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
16
 
17
+ # Copy application code
18
+ COPY ./app.py /code/app.py
19
  COPY ./templates /code/templates
20
 
21
  # Make port 7860 available to the world outside this container
22
  EXPOSE 7860
23
 
24
+ # Required environment variables:
25
+ # - PATENTSVIEW_API_KEY: Your PatentsView API key
26
+ # - OPENAI_API_KEY: Your OpenAI API key
27
+ # Example: docker run -e PATENTSVIEW_API_KEY=your_key -e OPENAI_API_KEY=your_openai_key ...
28
+
29
+ # Run gunicorn
 
 
 
 
 
 
 
 
 
 
 
30
  CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app", "--timeout", "300"]