basant307/AI_Governance_Project
045
1FROM python:3.11-slim-bookworm
2
3ENV PYTHONDONTWRITEBYTECODE=1 \
4 PYTHONUNBUFFERED=1 \
5 PIP_NO_CACHE_DIR=1
6
7WORKDIR /app
8
9RUN sed -i 's|http://deb.debian.org|https://deb.debian.org|g' /etc/apt/sources.list.d/debian.sources && \
10 apt-get update && \
11 apt-get install -y --no-install-recommends \
12 gcc \
13 g++ \
14 build-essential \
15 git \
16 curl \
17 libffi-dev \
18 libssl-dev && \
19 apt-get clean && \
20 rm -rf /var/lib/apt/lists/*
21
22COPY backend/requirements.txt .
23
24RUN python -m pip install --upgrade pip && \
25 pip install --no-cache-dir -r requirements.txt
26
27COPY backend/ .
28
29EXPOSE 8000
30
31HEALTHCHECK --interval=30s --timeout=10s --start-period=20s --retries=3 \
32CMD curl -f http://localhost:8000/health || exit 1
33
34CMD ["uvicorn","app.main:app","--host","0.0.0.0","--port","8000"]