Spaces:
Runtime error
Runtime error
dOCKER
Browse files- Dockerfile +9 -3
Dockerfile
CHANGED
|
@@ -7,16 +7,22 @@ WORKDIR /app
|
|
| 7 |
# Copy the current directory contents into the container at /app
|
| 8 |
COPY . /app
|
| 9 |
|
| 10 |
-
# Create directories for NLTK and Hugging Face cache data
|
| 11 |
-
RUN mkdir -p /app/nltk_data /app/.cache/huggingface /app/.huggingface_cache
|
| 12 |
-
&& chown -R 1000:1000 /app/nltk_data /app/.cache/huggingface /app/.huggingface_cache
|
| 13 |
|
|
|
|
| 14 |
ENV NLTK_DATA=/app/nltk_data
|
| 15 |
ENV HF_HOME=/app/.huggingface_cache
|
| 16 |
|
| 17 |
# Install any needed packages specified in requirements.txt
|
| 18 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
# Make port 7860 available to the world outside this container
|
| 21 |
EXPOSE 7860
|
| 22 |
|
|
|
|
| 7 |
# Copy the current directory contents into the container at /app
|
| 8 |
COPY . /app
|
| 9 |
|
| 10 |
+
# Create directories for NLTK and Hugging Face cache data
|
| 11 |
+
RUN mkdir -p /app/nltk_data /app/.cache/huggingface /app/.huggingface_cache
|
|
|
|
| 12 |
|
| 13 |
+
# Set environment variables
|
| 14 |
ENV NLTK_DATA=/app/nltk_data
|
| 15 |
ENV HF_HOME=/app/.huggingface_cache
|
| 16 |
|
| 17 |
# Install any needed packages specified in requirements.txt
|
| 18 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
|
| 20 |
+
# Change ownership of directories to the non-root user
|
| 21 |
+
RUN chown -R nobody:nogroup /app/nltk_data /app/.cache/huggingface /app/.huggingface_cache
|
| 22 |
+
|
| 23 |
+
# Switch to a non-root user
|
| 24 |
+
USER nobody
|
| 25 |
+
|
| 26 |
# Make port 7860 available to the world outside this container
|
| 27 |
EXPOSE 7860
|
| 28 |
|