Xxx / Dockerfile
XCarleX's picture
Rename Dockerfile.1 to Dockerfile
20454fd verified
FROM nvidia/cuda:12.4.1-devel-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive
ENV HF_HOME=/app/model_cache
ENV HF_HUB_CACHE=/app/model_cache/hub
ENV TORCH_HOME=/app/model_cache/torch
WORKDIR /app
# Sistema e toolchain
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.10 python3.10-dev python3.10-distutils python3-pip \
git wget curl ffmpeg libglib2.0-0 libsm6 libxext6 libxrender-dev \
libgomp1 build-essential ninja-build cmake \
&& rm -rf /var/lib/apt/lists/*
RUN ln -sf /usr/bin/python3.10 /usr/bin/python3 && \
ln -sf /usr/bin/python3.10 /usr/bin/python && \
python3 -m pip install --upgrade pip
# PyTorch 2.6.0 + cu124
RUN pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cu124 \
torch==2.6.0 torchvision torchaudio
# Dependências Python base do app (sem FA/Apex aqui)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt \
&& pip install --no-cache-dir "tiktoken>=0.7,<0.9"
# Copiar app e start
COPY . .
RUN chmod +x ./start.sh
# Usuário não-root
RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
USER appuser
ENV PORT=7860
CMD ["./start.sh"]