Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +11 -6
Dockerfile
CHANGED
|
@@ -13,8 +13,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 13 |
# Copy the requirements file
|
| 14 |
COPY requirements.txt requirements.txt
|
| 15 |
|
| 16 |
-
# Install Python packages
|
| 17 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
# Copy application code
|
| 20 |
COPY . /app
|
|
@@ -28,13 +28,18 @@ RUN chown -R user:user /app
|
|
| 28 |
# Switch to the non-root user
|
| 29 |
USER user
|
| 30 |
|
| 31 |
-
# Expose the port
|
| 32 |
EXPOSE 7860
|
| 33 |
|
| 34 |
-
# Set environment variables
|
| 35 |
ENV FLASK_HOST=0.0.0.0
|
| 36 |
ENV FLASK_PORT=7860
|
| 37 |
-
|
| 38 |
|
| 39 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
CMD ["python", "app.py"]
|
|
|
|
| 13 |
# Copy the requirements file
|
| 14 |
COPY requirements.txt requirements.txt
|
| 15 |
|
| 16 |
+
# Install Python packages with timeout increase
|
| 17 |
+
RUN pip install --no-cache-dir --timeout=1000 -r requirements.txt
|
| 18 |
|
| 19 |
# Copy application code
|
| 20 |
COPY . /app
|
|
|
|
| 28 |
# Switch to the non-root user
|
| 29 |
USER user
|
| 30 |
|
| 31 |
+
# Expose the port
|
| 32 |
EXPOSE 7860
|
| 33 |
|
| 34 |
+
# Set environment variables
|
| 35 |
ENV FLASK_HOST=0.0.0.0
|
| 36 |
ENV FLASK_PORT=7860
|
| 37 |
+
ENV FLASK_DEBUG=False
|
| 38 |
|
| 39 |
+
# CRITICAL: Set HF-specific env vars
|
| 40 |
+
ENV TRANSFORMERS_CACHE=/tmp/transformers_cache
|
| 41 |
+
ENV HF_HOME=/tmp/hf_home
|
| 42 |
+
ENV TORCH_HOME=/tmp/torch_home
|
| 43 |
+
|
| 44 |
+
# Command to run the app
|
| 45 |
CMD ["python", "app.py"]
|