Update Dockerfiel
Browse files- Dockerfile +10 -6
Dockerfile
CHANGED
@@ -1,17 +1,21 @@
|
|
1 |
-
# Use an official Python runtime as a parent image (
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
# Set the working directory in the container
|
5 |
WORKDIR /app
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
# Copy the requirements file into the container
|
8 |
COPY requirements.txt .
|
9 |
|
10 |
-
# Upgrade pip
|
11 |
-
RUN pip install --upgrade pip
|
12 |
-
|
13 |
-
# Install any needed packages specified in requirements.txt
|
14 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
15 |
|
16 |
# Download the spaCy English model
|
17 |
RUN python -m spacy download en_core_web_sm
|
|
|
1 |
+
# Use an official Python runtime as a parent image (Python 3.9)
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
# Set the working directory in the container
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Create a cache directory that is writable
|
8 |
+
RUN mkdir -p /app/.cache/huggingface/hub
|
9 |
+
|
10 |
+
# Set the environment variable to point to the writable cache directory
|
11 |
+
ENV TRANSFORMERS_CACHE=/app/.cache
|
12 |
+
|
13 |
# Copy the requirements file into the container
|
14 |
COPY requirements.txt .
|
15 |
|
16 |
+
# Upgrade pip and install dependencies
|
17 |
+
RUN pip install --upgrade pip && \
|
18 |
+
pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
19 |
|
20 |
# Download the spaCy English model
|
21 |
RUN python -m spacy download en_core_web_sm
|