# Use the official Python image FROM python:3.10-slim-bullseye # Set working directory WORKDIR /app # Copy requirements first for layer caching COPY requirements.txt . # Disable pip progress bar RUN pip config --user set global.progress_bar off # Build-time args ARG BITBUCKET_USER ARG BITBUCKET_PASS # Install system dependencies RUN apt-get update && \ apt-get install -y git && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # OPTIONAL: Install private Bitbucket package # Uncomment if needed RUN pip install --no-cache-dir \ "git+https://${BITBUCKET_USER}:${BITBUCKET_PASS}@bitbucket.org/credit_fair/python-core.git@dev#subdirectory=utils" # Copy app source COPY . . # Environment settings ENV OPENBLAS_NUM_THREADS=1 # Expose FastAPI port EXPOSE 8000 # Run FastAPI with uvicorn CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000", "--log-level", "info", "--workers", "1", "--limit-concurrency", "10"]