Spaces:
Runtime error
Runtime error
File size: 848 Bytes
e2579dc 00a6698 e2579dc aa383a1 e2579dc c0871b9 e2579dc d017f4c aa383a1 d017f4c c0871b9 aa383a1 d017f4c aa383a1 d017f4c e2579dc d017f4c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# Base image
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
# Install system dependencies
RUN apt-get update && apt-get install -y \
libglib2.0-0 \
libsm6 \
llibxrender1 \
libxext6 \
python3-venv \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Create a virtual environment
RUN python3 -m venv /app/venv
# Activate the virtual environment and install Python dependencies
RUN /app/venv/bin/pip install --upgrade pip \
&& /app/venv/bin/pip install --no-cache-dir -r /app/requirements.txt
# Ensure the virtual environment's Python and Pip are used by default
ENV PATH="/app/venv/bin:$PATH"
# Copy the project files
COPY . /app
# Expose the port (matching your app configuration)
EXPOSE 7860
# Start the FastAPI server
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |