Spaces:
Runtime error
Runtime error
| # ============================================================ | |
| # Dockerfile β Hugging Face Spaces (Docker SDK) | |
| # Free tier: 16GB RAM, 2 vCPU | |
| # HF exposes only port 7860 β nginx routes both Flask apps | |
| # | |
| # / β Flask 5000 (gesture + emotion) | |
| # /avatar/ β Flask 5001 (speech-to-sign) | |
| # ============================================================ | |
| FROM python:3.10-slim | |
| # HF Spaces runs as non-root user 1000 | |
| RUN useradd -m -u 1000 user | |
| USER root | |
| # ββ System deps βββββββββββββββββββββββββββββββββββββββββββββββ | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| libsm6 \ | |
| libxext6 \ | |
| libxrender-dev \ | |
| libgomp1 \ | |
| nginx \ | |
| supervisor \ | |
| curl \ | |
| git-lfs \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # ββ Python deps βββββββββββββββββββββββββββββββββββββββββββββββ | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # ββ App files βββββββββββββββββββββββββββββββββββββββββββββββββ | |
| COPY isl_detection.py . | |
| COPY isl_ui_dashboard.py . | |
| COPY launcher.py . | |
| COPY speech_to_sign_avatar.py . | |
| COPY translation.py . | |
| COPY unified_launcher.py . | |
| COPY model.h5 . | |
| COPY templates/ templates/ | |
| COPY start_gesture.py . | |
| # ββ Configs βββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| COPY nginx.conf /etc/nginx/nginx.conf | |
| COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | |
| # ββ Nginx log dir permissions βββββββββββββββββββββββββββββββββ | |
| RUN mkdir -p /var/log/nginx /var/log/supervisor /var/run \ | |
| && chmod -R 777 /var/log/nginx /var/log/supervisor /var/run \ | |
| && chown -R user:user /app | |
| # ββ Environment βββββββββββββββββββββββββββββββββββββββββββββββ | |
| ENV RUN_MODE=CLOUD | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV TF_CPP_MIN_LOG_LEVEL=3 | |
| ENV CUDA_VISIBLE_DEVICES=-1 | |
| # HF Spaces MUST use port 7860 | |
| EXPOSE 7860 | |
| # ββ Start supervisor as root (nginx needs it) βββββββββββββββββ | |
| USER root | |
| CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/supervisord.conf"] | |