docker_selfhosted / Dockerfile
Leon4gr45's picture
Update Dockerfile
65896ec verified
raw
history blame
651 Bytes
# 1. Start from a community-vetted, GPU-ready image
FROM runpod/pytorch:2.2.0-py3.10-cuda12.1.1-devel
# 2. Set up the environment
ENV DEBIAN_FRONTEND=noninteractive
ENV HF_HOME="/data/huggingface"
ENV UV_CACHE_DIR="/data/uv_cache"
# 3. The base image already has python, pip, etc. Install uv.
RUN pip install uv
# 4. Copy requirements and install them.
COPY requirements.txt .
RUN uv pip install --no-cache --system -r requirements.txt
# 5. Copy the application code.
COPY ./app.py /app/app.py
WORKDIR /app
# 6. Expose the port.
EXPOSE 7860
# 7. Run the application with uvicorn.
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]