Spaces:
Sleeping
Sleeping
update for timeout
Browse files- Dockerfile +78 -27
Dockerfile
CHANGED
@@ -1,40 +1,90 @@
|
|
1 |
-
# # # Use the official Python image from the Docker Hub
|
2 |
-
# # FROM python:3.10.0-slim-buster
|
3 |
|
4 |
-
# # # Set the working directory in the container
|
5 |
-
# # WORKDIR /app
|
6 |
|
7 |
-
# # # Copy the current directory contents into the container at /app
|
8 |
-
# # COPY . /app
|
9 |
|
10 |
-
# # # Upgrade pip to the latest version
|
11 |
-
# # RUN pip install --upgrade pip
|
12 |
|
13 |
-
# # # Install any needed packages specified in requirements.txt
|
14 |
-
# # RUN pip install --no-cache-dir -r requirements.txt
|
15 |
|
16 |
-
# # # Create directories for NLTK and Hugging Face cache data
|
17 |
-
# # RUN mkdir -p /app/nltk_data /app/.cache/huggingface /app/.huggingface_cache
|
18 |
|
19 |
-
# # # Download NLTK data (punkt and wordnet)
|
20 |
-
# # RUN python -m nltk.downloader -d /app/nltk_data punkt wordnet
|
21 |
|
22 |
-
# # # Set environment variables
|
23 |
-
# # ENV NLTK_DATA=/app/nltk_data
|
24 |
-
# # ENV HF_HOME=/app/.huggingface_cache
|
25 |
-
# # ENV TRANSFORMERS_CACHE=/app/.huggingface_cache
|
26 |
|
27 |
-
# # # Change ownership of directories to the non-root user
|
28 |
-
# # RUN chown -R nobody:nogroup /app/nltk_data /app/.huggingface_cache /app
|
29 |
|
30 |
-
# # # Switch to a non-root user
|
31 |
-
# # USER nobody
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
-
# # # Make port 7860 available to the world outside this container
|
34 |
-
# # EXPOSE 7860
|
35 |
|
36 |
-
# # # Command to run the application
|
37 |
-
# # CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|
38 |
|
39 |
|
40 |
# Use the official Python image from the Docker Hub
|
@@ -82,4 +132,5 @@ USER nobody
|
|
82 |
EXPOSE 7860
|
83 |
|
84 |
# Command to run the application
|
85 |
-
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|
|
|
|
1 |
+
# # # # Use the official Python image from the Docker Hub
|
2 |
+
# # # FROM python:3.10.0-slim-buster
|
3 |
|
4 |
+
# # # # Set the working directory in the container
|
5 |
+
# # # WORKDIR /app
|
6 |
|
7 |
+
# # # # Copy the current directory contents into the container at /app
|
8 |
+
# # # COPY . /app
|
9 |
|
10 |
+
# # # # Upgrade pip to the latest version
|
11 |
+
# # # RUN pip install --upgrade pip
|
12 |
|
13 |
+
# # # # Install any needed packages specified in requirements.txt
|
14 |
+
# # # RUN pip install --no-cache-dir -r requirements.txt
|
15 |
|
16 |
+
# # # # Create directories for NLTK and Hugging Face cache data
|
17 |
+
# # # RUN mkdir -p /app/nltk_data /app/.cache/huggingface /app/.huggingface_cache
|
18 |
|
19 |
+
# # # # Download NLTK data (punkt and wordnet)
|
20 |
+
# # # RUN python -m nltk.downloader -d /app/nltk_data punkt wordnet
|
21 |
|
22 |
+
# # # # Set environment variables
|
23 |
+
# # # ENV NLTK_DATA=/app/nltk_data
|
24 |
+
# # # ENV HF_HOME=/app/.huggingface_cache
|
25 |
+
# # # ENV TRANSFORMERS_CACHE=/app/.huggingface_cache
|
26 |
|
27 |
+
# # # # Change ownership of directories to the non-root user
|
28 |
+
# # # RUN chown -R nobody:nogroup /app/nltk_data /app/.huggingface_cache /app
|
29 |
|
30 |
+
# # # # Switch to a non-root user
|
31 |
+
# # # USER nobody
|
32 |
+
|
33 |
+
# # # # Make port 7860 available to the world outside this container
|
34 |
+
# # # EXPOSE 7860
|
35 |
+
|
36 |
+
# # # # Command to run the application
|
37 |
+
# # # CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|
38 |
+
|
39 |
+
|
40 |
+
# # Use the official Python image from the Docker Hub
|
41 |
+
# FROM python:3.10.0-slim-buster
|
42 |
+
|
43 |
+
# # Set the working directory in the container
|
44 |
+
# WORKDIR /app
|
45 |
+
|
46 |
+
# # Copy the current directory contents into the container at /app
|
47 |
+
# COPY . /app
|
48 |
+
|
49 |
+
# # Upgrade pip to the latest version
|
50 |
+
# RUN pip install --upgrade pip
|
51 |
+
|
52 |
+
# # Install build essentials and gfortran
|
53 |
+
# RUN apt-get update && apt-get install -y \
|
54 |
+
# build-essential \
|
55 |
+
# gfortran \
|
56 |
+
# && rm -rf /var/lib/apt/lists/*
|
57 |
+
|
58 |
+
# # Install any needed packages specified in requirements.txt
|
59 |
+
# RUN pip install --no-cache-dir -r requirements.txt
|
60 |
+
|
61 |
+
# # Install NumPy version 1.21.0
|
62 |
+
# RUN pip install --no-cache-dir numpy==1.21.0
|
63 |
+
|
64 |
+
# # Create directories for NLTK and Hugging Face cache data
|
65 |
+
# RUN mkdir -p /app/nltk_data /app/.cache/huggingface /app/.huggingface_cache
|
66 |
+
|
67 |
+
# # Download NLTK data (punkt and wordnet)
|
68 |
+
# RUN python -m nltk.downloader -d /app/nltk_data punkt wordnet
|
69 |
+
|
70 |
+
# # Set environment variables
|
71 |
+
# ENV NLTK_DATA=/app/nltk_data
|
72 |
+
# ENV HF_HOME=/app/.huggingface_cache
|
73 |
+
# ENV TRANSFORMERS_CACHE=/app/.huggingface_cache
|
74 |
+
|
75 |
+
# # Change ownership of directories to the non-root user
|
76 |
+
# RUN chown -R nobody:nogroup /app/nltk_data /app/.huggingface_cache /app
|
77 |
+
|
78 |
+
# # Switch to a non-root user
|
79 |
+
# USER nobody
|
80 |
+
|
81 |
+
# # Make port 7860 available to the world outside this container
|
82 |
+
# EXPOSE 7860
|
83 |
+
|
84 |
+
# # Command to run the application
|
85 |
+
# CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|
86 |
|
|
|
|
|
87 |
|
|
|
|
|
88 |
|
89 |
|
90 |
# Use the official Python image from the Docker Hub
|
|
|
132 |
EXPOSE 7860
|
133 |
|
134 |
# Command to run the application
|
135 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "2", "--timeout", "120", "app:app"]
|
136 |
+
|