Code-Test-generator / Dockerfile
Jaiwincr7
FINAL DOCKERFIX: Ensuring Dockerfile copies pdf_utils.py instead of the nonexistent main.py.
ea450ca
# Use a Debian-based Python image.
FROM python:3.10
# Set the working directory
WORKDIR /app
# Expose the port Streamlit runs on
EXPOSE 8501
# Copy the requirements file and application code
COPY requirements.txt .
COPY pdf_utils.py .
COPY merged.py .
COPY app.py .
# --- ROBUST DEPENDENCY INSTALLATION ---
# 1. Upgrade pip for stability
RUN pip install --upgrade pip
# 2. Install PyTorch ONLY, using the CPU-specific index.
RUN pip install torch --index-url https://download.pytorch.org/whl/cpu
# 3. Install all remaining complex and general dependencies using the standard index (PyPI).
# We install these explicitly here since they were previously excluded from requirements.txt
RUN pip install \
accelerate \
transformers \
huggingface-hub
# 4. Install the final, smaller dependencies from the trimmed requirements.txt
RUN pip install -r requirements.txt
RUN apt-get update && apt-get install -y fonts-dejavu
# --- END INSTALLATION ---
# Command to run the Streamlit application
CMD ["streamlit", "run", "app.py", "--server.port", "8501", "--server.address", "0.0.0.0"]