Spaces:
Runtime error
Runtime error
Docker
Browse files- Dockerfile +8 -5
Dockerfile
CHANGED
|
@@ -7,24 +7,27 @@ 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 |
|
| 13 |
# Change ownership of directories to the non-root user
|
| 14 |
RUN chown -R nobody:nogroup /app
|
| 15 |
|
|
|
|
|
|
|
|
|
|
| 16 |
# Set environment variables
|
| 17 |
ENV NLTK_DATA=/app/nltk_data
|
| 18 |
ENV HF_HOME=/app/.huggingface_cache
|
| 19 |
|
| 20 |
-
# Switch to a non-root user
|
| 21 |
-
USER nobody
|
| 22 |
-
|
| 23 |
# Install any needed packages specified in requirements.txt
|
| 24 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 25 |
|
| 26 |
# Make port 7860 available to the world outside this container
|
| 27 |
-
EXPOSE
|
| 28 |
|
| 29 |
# Command to run the application
|
| 30 |
-
CMD ["gunicorn", "--bind", "0.0.0.0:
|
|
|
|
| 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 |
# Create directories for NLTK and Hugging Face cache data
|
| 14 |
RUN mkdir -p /app/nltk_data /app/.cache/huggingface /app/.huggingface_cache
|
| 15 |
|
| 16 |
# Change ownership of directories to the non-root user
|
| 17 |
RUN chown -R nobody:nogroup /app
|
| 18 |
|
| 19 |
+
# Switch to a non-root user
|
| 20 |
+
USER nobody
|
| 21 |
+
|
| 22 |
# Set environment variables
|
| 23 |
ENV NLTK_DATA=/app/nltk_data
|
| 24 |
ENV HF_HOME=/app/.huggingface_cache
|
| 25 |
|
|
|
|
|
|
|
|
|
|
| 26 |
# Install any needed packages specified in requirements.txt
|
| 27 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 28 |
|
| 29 |
# Make port 7860 available to the world outside this container
|
| 30 |
+
EXPOSE 7860
|
| 31 |
|
| 32 |
# Command to run the application
|
| 33 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|