File size: 1,110 Bytes
350b54b |
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 34 35 36 37 38 39 40 41 42 43 44 45 |
FROM nvidia/cuda:12.1.0-runtime-ubuntu22.04
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-setuptools \
python3-dev \
build-essential \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Create a working directory
WORKDIR /app
# Installa dipendenze
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Prepara directory di output con permessi corretti
RUN mkdir -p ./model_checkpoints ./model /tmp/huggingface_cache /app/embedding && \
chmod 777 ./model_checkpoints ./model /tmp/huggingface_cache /app/embedding
# Copia tutti i file necessari
COPY *.py .
COPY users.json .
COPY run.sh .
RUN chmod +x run.sh
# Crea uno script per eseguire il processo e poi copiare i file
#python generate_embeddings.py\n\
# Esegui lo script
# Esponi la porta per l'interfaccia web
EXPOSE 7860
# Set the entrypoint
ENTRYPOINT ["./run.sh"] |