vishalsh13's picture
docker up
4a2d6e9
raw
history blame
1.3 kB
# CUDA-enabled base image with Ubuntu 20.04
FROM nvidia/cuda:11.8.0-base-ubuntu20.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
# Add deadsnakes PPA for Python 3.11
RUN apt-get update && apt-get install -y software-properties-common && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get update
# Install Python 3.11 and required packages
RUN apt-get install -y \
python3.11 python3.11-distutils python3.11-dev python3-pip git wget unzip && \
rm -rf /var/lib/apt/lists/*
# Update alternatives to set Python 3.11 as default
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 && \
update-alternatives --config python3
# Upgrade pip to the latest version
RUN python3 -m pip install --upgrade pip
# Set the working directory
WORKDIR /app
# Copy the application files
COPY . .
# Set Hugging Face cache directory
ENV TRANSFORMERS_CACHE=/app/cache
RUN mkdir -p /app/cache && chmod -R 777 /app/cache
# Create directories with proper read/write permissions
RUN mkdir -p /app/uploads/vectors && \
chmod -R 777 /app/uploads
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Expose the Flask app's port
EXPOSE 7860
# Start the Flask app
CMD ["python3", "run.py"]