Spaces:
Runtime error
Runtime error
update dockerfile
Browse files- Dockerfile +50 -2
Dockerfile
CHANGED
|
@@ -1,3 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# # Use the official Python image from the Docker Hub
|
| 2 |
# FROM python:3.10.0-slim-buster
|
| 3 |
|
|
@@ -10,9 +49,18 @@
|
|
| 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 |
|
|
@@ -70,7 +118,6 @@ RUN python -m nltk.downloader -d /app/nltk_data punkt wordnet
|
|
| 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
|
|
@@ -82,5 +129,6 @@ USER nobody
|
|
| 82 |
EXPOSE 7860
|
| 83 |
|
| 84 |
# Command to run the application
|
| 85 |
-
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|
|
|
|
| 86 |
|
|
|
|
| 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 |
|
|
|
|
| 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 |
|
|
|
|
| 118 |
# Set environment variables
|
| 119 |
ENV NLTK_DATA=/app/nltk_data
|
| 120 |
ENV HF_HOME=/app/.huggingface_cache
|
|
|
|
| 121 |
|
| 122 |
# Change ownership of directories to the non-root user
|
| 123 |
RUN chown -R nobody:nogroup /app/nltk_data /app/.huggingface_cache /app
|
|
|
|
| 129 |
EXPOSE 7860
|
| 130 |
|
| 131 |
# Command to run the application
|
| 132 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "600", "app:app"]
|
| 133 |
+
|
| 134 |
|