chnage dockerfile
Browse files- Dockerfile +9 -2
Dockerfile
CHANGED
|
@@ -4,17 +4,24 @@ FROM python:3.10-slim
|
|
| 4 |
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Install dependencies
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
build-essential \
|
| 10 |
python3-dev \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
# Copy app code
|
| 14 |
COPY app.py /app/app.py
|
| 15 |
COPY requirements.txt /app/requirements.txt
|
| 16 |
|
| 17 |
-
#
|
|
|
|
|
|
|
|
|
|
| 18 |
RUN pip install --upgrade pip && pip install -r requirements.txt
|
| 19 |
|
| 20 |
# Expose the port
|
|
|
|
| 4 |
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Install dependencies
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
build-essential \
|
| 10 |
python3-dev \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
+
# Set environment variable to avoid permission errors
|
| 14 |
+
ENV TRANSFORMERS_CACHE=/app/cache
|
| 15 |
+
ENV HF_HOME=/app/cache
|
| 16 |
+
|
| 17 |
# Copy app code
|
| 18 |
COPY app.py /app/app.py
|
| 19 |
COPY requirements.txt /app/requirements.txt
|
| 20 |
|
| 21 |
+
# Create the cache directory
|
| 22 |
+
RUN mkdir -p /app/cache
|
| 23 |
+
|
| 24 |
+
# Install Python dependencies
|
| 25 |
RUN pip install --upgrade pip && pip install -r requirements.txt
|
| 26 |
|
| 27 |
# Expose the port
|