Spaces:
Sleeping
Sleeping
| # Base image with PyTorch and CUDA support | |
| FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04 | |
| # Set environment variables | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| # Install essential packages | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| python3.8 \ | |
| python3-pip \ | |
| python3-venv \ | |
| git \ | |
| wget \ | |
| libgl1-mesa-glx \ | |
| && apt-get clean && rm -rf /var/lib/apt/lists/* | |
| # Set Python aliases | |
| RUN ln -s /usr/bin/python3.8 /usr/bin/python && \ | |
| ln -s /usr/bin/pip3 /usr/bin/pip | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR /app | |
| COPY --chown=user ./requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| COPY --chown=user . /app | |
| EXPOSE 7860 | |
| CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"] |