Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -2
Dockerfile
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
FROM python:3.11.7-slim
|
| 2 |
|
| 3 |
# Set up a new user named "user" with user ID 1000
|
|
@@ -18,8 +19,13 @@ RUN apt-get update && apt-get install -y \
|
|
| 18 |
# Copy requirements first to leverage Docker cache
|
| 19 |
COPY --chown=user:user requirements.txt .
|
| 20 |
|
| 21 |
-
# Install Python dependencies
|
| 22 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
# Copy the application code
|
| 25 |
COPY --chown=user:user . .
|
|
|
|
| 1 |
+
# Use Python 3.11.7 slim image as base
|
| 2 |
FROM python:3.11.7-slim
|
| 3 |
|
| 4 |
# Set up a new user named "user" with user ID 1000
|
|
|
|
| 19 |
# Copy requirements first to leverage Docker cache
|
| 20 |
COPY --chown=user:user requirements.txt .
|
| 21 |
|
| 22 |
+
# Install Python dependencies and spaCy model as root
|
| 23 |
+
RUN pip install --no-cache-dir -r requirements.txt && \
|
| 24 |
+
python -m spacy download en_core_web_sm && \
|
| 25 |
+
# Verify the model installation
|
| 26 |
+
python -c "import spacy; spacy.load('en_core_web_sm')" && \
|
| 27 |
+
# Ensure proper permissions for the spaCy model directory
|
| 28 |
+
chown -R user:user /usr/local/lib/python3.11/site-packages/en_core_web_sm
|
| 29 |
|
| 30 |
# Copy the application code
|
| 31 |
COPY --chown=user:user . .
|