Spaces:
Running
Running
File size: 955 Bytes
9055921 bbfadbe 7ec0b55 9055921 bbfadbe 9055921 bbfadbe 9055921 bbfadbe 9055921 7ec0b55 9055921 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | # ================================================================
# ASAD AI — Dockerfile v3.0
# HuggingFace Spaces optimized
# /data/ = persistent storage (enable in Space settings)
# ================================================================
FROM python:3.10-slim
# System deps
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc g++ curl git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Python packages
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
# Source files
COPY train.py .
COPY app.py .
# Persistent storage dir (mount HF persistent disk here)
RUN mkdir -p /data && chmod 777 /data
ENV STORAGE_DIR=/data
# HF cache dir (optional speedup)
ENV HF_HOME=/data/hf_cache
ENV TRANSFORMERS_CACHE=/data/hf_cache
# Gradio config
ENV GRADIO_SERVER_NAME=0.0.0.0
ENV GRADIO_SERVER_PORT=7860
EXPOSE 7860
CMD ["python", "app.py"]
|