Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files123456782 unmodified lines11121314151617181920212223242526272829FROM python:3.10-slimENV PYTHONUNBUFFERED=1ENV HF_HOME=/root/.cache/huggingfaceENV TORCH_HOME=/root/.cache/torchENV PIP_NO_CACHE_DIR=1RUN apt-get update && apt-get install -y \2 unmodified lineslibsndfile1 \&& rm -rf /var/lib/apt/lists/*WORKDIR /appCOPY requirements.txt .RUN pip install --upgrade pipRUN pip install -r requirements.txtCOPY . .# Run from the js/ subdirectory so relative imports workRUN cd /app/js && python download_model.pyEXPOSE 7860# Launch uvicorn with --app-dir pointing at js/ so it finds app.py as# a top-level module (avoids the js.app package resolution overhead)CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--app-dir", "/app/js"]1234562 unmodified lines9101112131415161718192021222324252627282930313233343536FROM python:3.10-slimENV PYTHONUNBUFFERED=1ENV PIP_NO_CACHE_DIR=1RUN apt-get update && apt-get install -y \2 unmodified lineslibsndfile1 \&& rm -rf /var/lib/apt/lists/*# Set up a new user named "user" with user ID 1000 to match Hugging Face's runtime userRUN useradd -m -u 1000 userUSER user# Set env variables pointing to the user's home directoryENV HOME=/home/user \PATH=/home/user/.local/bin:$PATH \HF_HOME=/home/user/.cache/huggingface \TORCH_HOME=/home/user/.cache/torchWORKDIR $HOME/appCOPY --chown=user requirements.txt .RUN pip install --upgrade pip && pip install -r requirements.txtCOPY --chown=user . .# Run the downloader as user 'user' so weights are baked into the accessible home directory cacheRUN cd js && python download_model.pyEXPOSE 7860# Launch uvicorn with --app-dir pointing at js/ so it finds app.py as# a top-level module (avoids the js.app package resolution overhead)CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--app-dir", "js"]
Dockerfile+17-10