# Data Service Dockerfile # OrbiQuant IA Trading Platform # Python 3.11 + FastAPI FROM python:3.11-slim # Environment ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ PYTHONPATH=/app/src \ PIP_NO_CACHE_DIR=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 # System dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ curl \ gcc \ libpq-dev \ && rm -rf /var/lib/apt/lists/* # Create app user RUN useradd --create-home --shell /bin/bash appuser # Working directory WORKDIR /app # Install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy source code COPY --chown=appuser:appuser src/ /app/src/ # Create logs directory RUN mkdir -p /app/logs && chown appuser:appuser /app/logs # Switch to non-root user USER appuser # Expose port EXPOSE 8001 # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ CMD curl -f http://localhost:8001/health || exit 1 # Run application CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8001"]