anime-gen-api / Dockerfile
AswinMathew's picture
Upload folder using huggingface_hub
7190fd0 verified
FROM python:3.12-slim
# Install FFmpeg + git
RUN apt-get update && \
apt-get install -y --no-install-recommends ffmpeg git && \
rm -rf /var/lib/apt/lists/*
# Create non-root user (HF Spaces requirement)
RUN useradd -m -u 1000 user
WORKDIR /app
# Install Python dependencies (cache layer)
RUN pip install --no-cache-dir \
"fastapi[standard]>=0.115.0" \
"uvicorn[standard]>=0.32.0" \
"sqlalchemy[asyncio]>=2.0.0" \
"aiosqlite>=0.20.0" \
"pydantic>=2.0.0" \
"pydantic-settings>=2.0.0" \
"python-jose[cryptography]>=3.3.0" \
"passlib[bcrypt]>=1.7.4" \
"python-multipart>=0.0.9" \
"httpx>=0.27.0" \
"edge-tts>=6.1.0" \
"Pillow>=10.0.0" \
"pymupdf>=1.24.0" \
"opencv-python-headless>=4.9.0" \
"numpy>=1.26.0" \
"pocket-tts>=0.1.0" \
"huggingface-hub>=0.20.0" \
"scipy>=1.12.0" \
"safetensors>=0.4.0" \
"pyarrow>=15.0.0" \
"soundfile>=0.12.0"
# Copy application code
COPY app/ app/
COPY data/*.json data/
COPY scripts/ scripts/
COPY deploy/start.sh .
RUN chmod +x start.sh
# Create directories with correct permissions
RUN mkdir -p /data/workdir/projects /data/genshin_voices /data/animevox_voices && \
chown -R user:user /app /data
USER user
EXPOSE 7860
CMD ["./start.sh"]