Spaces:
Runtime error
Runtime error
Docker
Browse files- Dockerfile +4 -4
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# Use the official Python image from the Docker
|
| 2 |
FROM python:3.10.0-slim-buster
|
| 3 |
|
| 4 |
# Set the working directory in the container
|
|
@@ -13,10 +13,10 @@ RUN pip install --upgrade pip
|
|
| 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)
|
| 20 |
RUN python -m nltk.downloader -d /app/nltk_data punkt
|
| 21 |
|
| 22 |
# Set environment variables
|
|
@@ -24,7 +24,7 @@ ENV NLTK_DATA=/app/nltk_data
|
|
| 24 |
ENV HF_HOME=/app/.huggingface_cache
|
| 25 |
|
| 26 |
# Change ownership of directories to the non-root user
|
| 27 |
-
RUN chown -R nobody:nogroup /app/nltk_data /app/.huggingface_cache
|
| 28 |
|
| 29 |
# Switch to a non-root user
|
| 30 |
USER nobody
|
|
|
|
| 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
|
|
|
|
| 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)
|
| 20 |
RUN python -m nltk.downloader -d /app/nltk_data punkt
|
| 21 |
|
| 22 |
# Set environment variables
|
|
|
|
| 24 |
ENV HF_HOME=/app/.huggingface_cache
|
| 25 |
|
| 26 |
# Change ownership of directories to the non-root user
|
| 27 |
+
RUN chown -R nobody:nogroup /app/nltk_data /app/.huggingface_cache /app
|
| 28 |
|
| 29 |
# Switch to a non-root user
|
| 30 |
USER nobody
|