Spaces:
Runtime error
Runtime error
update docker
Browse files- Dockerfile +2 -51
Dockerfile
CHANGED
|
@@ -37,54 +37,6 @@
|
|
| 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 |
# Use the official Python image from the Docker Hub
|
| 89 |
FROM python:3.10.0-slim-buster
|
| 90 |
|
|
@@ -118,6 +70,7 @@ RUN python -m nltk.downloader -d /app/nltk_data punkt wordnet
|
|
| 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,6 +82,4 @@ USER nobody
|
|
| 129 |
EXPOSE 7860
|
| 130 |
|
| 131 |
# Command to run the application
|
| 132 |
-
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "
|
| 133 |
-
|
| 134 |
-
|
|
|
|
| 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 |
|
|
|
|
| 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 |
EXPOSE 7860
|
| 83 |
|
| 84 |
# Command to run the application
|
| 85 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|
|
|
|
|
|