Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +3 -3
Dockerfile
CHANGED
|
@@ -38,11 +38,11 @@ COPY --chown=appuser:appuser requirements.txt .
|
|
| 38 |
|
| 39 |
USER appuser
|
| 40 |
|
| 41 |
-
# Install dependencies
|
|
|
|
| 42 |
RUN pip install --upgrade pip && \
|
| 43 |
-
pip install --no-cache-dir -r requirements.txt && \
|
| 44 |
python -m spacy download en_core_web_sm
|
| 45 |
-
|
| 46 |
# --- OPTIMIZATION: Copy the rest of the code AFTER dependencies are installed ---
|
| 47 |
COPY --chown=appuser:appuser . .
|
| 48 |
|
|
|
|
| 38 |
|
| 39 |
USER appuser
|
| 40 |
|
| 41 |
+
# 7. Install Python dependencies as non-root user
|
| 42 |
+
USER appuser
|
| 43 |
RUN pip install --upgrade pip && \
|
| 44 |
+
pip install --no-cache-dir --prefer-binary -r requirements.txt && \
|
| 45 |
python -m spacy download en_core_web_sm
|
|
|
|
| 46 |
# --- OPTIMIZATION: Copy the rest of the code AFTER dependencies are installed ---
|
| 47 |
COPY --chown=appuser:appuser . .
|
| 48 |
|