asad-ai / Dockerfile
Asad-ullah008's picture
Upload 5 files
9055921 verified
raw
history blame contribute delete
955 Bytes
# ================================================================
# 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"]