content-guard / Dockerfile
bravo24's picture
Update Dockerfile
6b67306 verified
FROM python:3.10-slim
# ══════════════════════════════════════════════════
# Sistem paketleri β€” TEK BLOK (v5.0 ile aynΔ± pattern)
# ══════════════════════════════════════════════════
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
libgl1 \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
wget \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# ══════════════════════════════════════════════════
# Python paketleri (v5.0 ile AYNI pattern)
# ══════════════════════════════════════════════════
# Core
RUN pip install --no-cache-dir \
numpy==1.24.4 \
fastapi==0.104.1 \
uvicorn==0.24.0 \
python-multipart==0.0.6 \
pydantic==2.5.0 \
pillow==10.1.0 \
"requests>=2.28.0"
# AI / Deep Learning (CPU)
RUN pip install --no-cache-dir \
torch==2.1.2+cpu \
torchvision==0.16.2+cpu \
--index-url https://download.pytorch.org/whl/cpu
RUN pip install --no-cache-dir \
transformers==4.36.2 \
"accelerate>=0.21.0" \
"huggingface_hub>=0.19.0"
# NSFW Detection
RUN pip install --no-cache-dir \
"onnxruntime>=1.16.0" \
"nudenet>=3.3.0"
# Object Detection
RUN pip install --no-cache-dir \
ultralytics==8.0.227
# Computer Vision
RUN pip install --no-cache-dir \
opencv-python-headless==4.8.1.78
# Text Moderation
RUN pip install --no-cache-dir \
"detoxify>=0.5.0"
# OCR
RUN pip install --no-cache-dir \
"easyocr>=1.7.0"
# English Profanity
RUN pip install --no-cache-dir scikit-learn==1.3.2
RUN pip install --no-cache-dir alt-profanity-check || \
echo "alt-profanity-check failed, regex fallback will be used"
# Audio Copyright
RUN pip install --no-cache-dir \
"pyacoustid>=1.3.0" || echo "pyacoustid skipped"
# Utilities
RUN pip install --no-cache-dir \
"gdown>=4.7.1"
# CLIP modelini build sΔ±rasΔ±nda cache'e al (v5.0 ile AYNI)
RUN python -c "from transformers import CLIPModel, CLIPProcessor; \
CLIPModel.from_pretrained('laion/CLIP-ViT-B-32-laion2B-s34B-b79K'); \
CLIPProcessor.from_pretrained('laion/CLIP-ViT-B-32-laion2B-s34B-b79K')"
# ══════════════════════════════════════════════════
# Uygulama (v5.0 ile AYNI pattern)
# ══════════════════════════════════════════════════
COPY app.py .
EXPOSE 7860
# v5.0 ile AYNI: direkt uvicorn, startup.sh YOK
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]