Hoghoghi / dockerfile
Really-amin's picture
Upload 4 files
5199dd3 verified
raw
history blame
735 Bytes
# Dockerfile
FROM python:3.9-slim
WORKDIR /app
# نصب dependencies سیستمی
RUN apt-get update && apt-get install -y \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
# کپی فایل requirements
COPY requirements.txt .
# نصب پکیج های پایتون
RUN pip install --no-cache-dir -r requirements.txt
# کپی فایل اصلی
COPY persian_legal_scraper.py .
# ایجاد دایرکتوری های کش
RUN mkdir -p /tmp/hf_cache /tmp/torch_cache
# تنظیم محیط
ENV TRANSFORMERS_CACHE=/tmp/hf_cache
ENV HF_HOME=/tmp/hf_cache
ENV TORCH_HOME=/tmp/torch_cache
ENV TOKENIZERS_PARALLELISM=false
# پورت اکسپوز
EXPOSE 7860
# اجرای برنامه
CMD ["python", "persian_legal_scraper.py"]