selenium/thesis-file
0
1# Use the official Python 3.10 slim image as the base2FROM python:3.10-slim3 4# Set environment variable to suppress interactive prompts during package installation5ENV DEBIAN_FRONTEND=noninteractive6ENV PORT 8080 # Set a default port for robustness (and to match README.md)7 8# --- STEP 1: INSTALL SYSTEM DEPENDENCIES ---9RUN apt-get update && \10 apt-get install -y --no-install-recommends \11 tesseract-ocr \12 tesseract-ocr-eng \13 poppler-utils \14 build-essential \15 libglib2.0-0 && \16 apt-get clean && \17 rm -rf /var/lib/apt/lists/*18 19# --- STEP 2: COPY CODE AND INSTALL PYTHON DEPENDENCIES ---20# Set the working directory to the root of the app21WORKDIR /app22 23# Copy all local files into the container's /app directory.24COPY . /app25 26# The requirements file is now located at /app/backend/requirements.txt inside the container.27RUN pip install --no-cache-dir -r /app/backend/requirements.txt28 29# --- STEP 3: START THE APPLICATION (FIXED PORT ERROR) ---30# FIX: Switched to the Shell Form of CMD to ensure the $PORT variable 31# is correctly expanded and passed as a number to Gunicorn.32CMD gunicorn -w 1 -b 0.0.0.0:$PORT backend.app:app