pixtral-demo / Dockerfile
alexandraroze's picture
updated docker
419973f
raw
history blame
1.55 kB
# Use NVIDIA CUDA base image
FROM nvidia/cuda:12.3.2-cudnn9-devel-ubuntu22.04
# Install system dependencies for Python and Poetry
RUN apt-get update && apt-get install -y \
python3 python3-pip python3-venv build-essential curl git \
&& rm -rf /var/lib/apt/lists/*
# Install Poetry globally
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir poetry
# Set environment variables for Poetry and Python
ENV POETRY_VIRTUALENVS_CREATE=false \
POETRY_CACHE_DIR=/root/.cache/pypoetry \
PATH="/root/.local/bin:$PATH"
# Set the working directory
WORKDIR /app
# Copy Poetry configuration files
COPY pyproject.toml ./
# Install Python dependencies with Poetry
RUN poetry install --no-interaction --no-ansi \
&& pip install --no-build-isolation flash-attn \
&& pip install "rerankers[all]"
RUN useradd -m -u 1000 user
USER user
ENV HOME /home/user
ENV PATH $HOME/.local/bin:$PATH
# Copy the rest of the application
WORKDIR $HOME
RUN mkdir app
WORKDIR $HOME/app
COPY . $HOME/app
# Expose a port if needed (update according to your application)
#EXPOSE 8501
#
#CMD streamlit run app.py \
# --server.headless true \
# --server.enableCORS false \
# --server.enableXsrfProtection false \
# --server.fileWatcherType none
EXPOSE 7860
CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0", "--server.port=7860"]
#EXPOSE 8501
#
#HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
#
#ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]