| |
|
|
| |
| |
| |
| FROM node:20-alpine AS frontend-build |
|
|
| WORKDIR /frontend |
|
|
| COPY frontend/package.json frontend/package-lock.json* ./ |
| RUN npm ci |
|
|
| COPY frontend/ ./ |
|
|
| ARG VITE_API_BASE_URL=/api |
| ENV VITE_API_BASE_URL=$VITE_API_BASE_URL |
|
|
| RUN npm run build |
|
|
| |
| |
| |
| FROM python:3.12-slim-bookworm |
|
|
| ENV PYTHONDONTWRITEBYTECODE=1 \ |
| PYTHONUNBUFFERED=1 \ |
| PYTHONPATH=/app \ |
| HF_HOME=/app/.cache/huggingface \ |
| TRANSFORMERS_CACHE=/app/.cache/huggingface \ |
| HF_HUB_CACHE=/app/.cache/huggingface/hub \ |
| PIP_NO_CACHE_DIR=1 |
|
|
| WORKDIR /app |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| git \ |
| build-essential \ |
| ffmpeg \ |
| libsndfile1 \ |
| curl \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| COPY backend/requirements.txt ./backend/requirements.txt |
| RUN pip install --no-cache-dir -r backend/requirements.txt |
|
|
| |
| COPY backend ./backend |
| COPY app ./app |
| COPY constants ./constants |
|
|
| |
| RUN mkdir -p /app/.cache/huggingface/hub && \ |
| python -c "from huggingface_hub import snapshot_download; \ |
| snapshot_download('rufaelfekadu/diac-transformer-text-asr-tashkeela-clartts', \ |
| cache_dir='/app/.cache/huggingface/hub')" |
|
|
| |
| COPY --from=frontend-build /frontend/dist ./static |
|
|
| |
| RUN chmod -R 777 /app/.cache |
|
|
| EXPOSE 7860 |
|
|
| CMD ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "7860"] |
|
|