FROM python:3.10.9 WORKDIR /code ENV TRANSFORMERS_CACHE=/tmp/cache/huggingface ENV NUMBA_CACHE_DIR=/tmp/numba_cache ENV MPLCONFIGDIR=/tmp/matplotlib-cache ENV HF_HOME=/tmp/huggingface-cache COPY ./requirements.txt /code/requirements.txt RUN mkdir -p /tmp/numba_cache && chmod -R 777 /tmp/numba_cache RUN mkdir -p /tmp/Models/pretrained_models && chmod -R 777 /tmp/Models/pretrained_models RUN mkdir -p /tmp/cache/huggingface && chmod -R 777 /tmp/cache/huggingface RUN mkdir -p /tmp/matplotlib-cache && chmod -R 777 /tmp/matplotlib-cache RUN mkdir -p /tmp/huggingface-cache && chmod -R 777 /tmp/huggingface-cache RUN --mount=type=secret,id=GITHUB_REPO,mode=0444,required=true \ git clone $(cat /run/secrets/GITHUB_REPO) /tmp/TTS RUN apt-get update && apt-get install -y ffmpeg WORKDIR /tmp/TTS RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt RUN chmod -R 777 /usr/local/lib/python3.10/site-packages/pyopenjtalk COPY . . CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]