Spaces:
Build error
Build error
# Use the official Python 3.11.9 image | |
FROM python:3.11.9 | |
# Set up a new user named "user" with user ID 1000 | |
RUN useradd -m -u 1000 user | |
# Set the home to the user's home directory and add user's local bin to PATH | |
ENV HOME=/home/user \ | |
PATH=/home/user/.local/bin:$PATH | |
# Switch to the "user" user | |
USER user | |
# Create the app directory | |
WORKDIR $HOME/app | |
# Copy the application code and the requirements.txt file | |
COPY --chown=user . $HOME/app | |
# Download VOICEVOX Nemo Core from latest Release | |
RUN curl -sSfL https://github.com/VOICEVOX/voicevox_nemo_core/releases/latest/download/download-linux-x64 --output download | |
# Give execution permissions | |
RUN chmod +x ./download | |
# Install VOICEVOX Nemo Core | |
RUN ./download --output voicevox_nemo_core | |
# Clone VOICEVOX Nemo Engine from Git Repository | |
RUN git clone https://github.com/VOICEVOX/voicevox_nemo_engine.git voicevox_nemo_engine | |
# ---------- Important! https://github.com/VOICEVOX/voicevox_engine/issues/1568 (Related) ---------- | |
# Install requirements.txt | |
RUN pip install --requirement voicevox_nemo_engine/requirements.txt | |
# Start the FastAPI app on port 7860, the default port expected by Spaces | |
CMD ["python", "voicevox_nemo_engine/run.py", "--voicelib_dir", "voicevox_nemo_core", "--host", "0.0.0.0", "--port", "7860", "--cors_policy_mode", "all"] |