39 lines
918 B
Docker
39 lines
918 B
Docker
FROM python:3.10-slim
|
|
|
|
LABEL maintainer="AI Email Assistant Team"
|
|
LABEL version="1.0.0"
|
|
LABEL description="AI Email Assistant with RAG and LangGraph"
|
|
|
|
RUN groupadd -r appuser && useradd -r -g appuser appuser
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
gcc \
|
|
g++ \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& apt-get clean
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir --upgrade pip && \
|
|
pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY . .
|
|
|
|
RUN mkdir -p /app/storage/chroma /app/data/ && \
|
|
chown -R appuser:appuser /app && \
|
|
chmod -R 755 /app/storage
|
|
|
|
USER appuser
|
|
|
|
ENV PYTHONPATH=/app
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
|
|
EXPOSE 8000
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
|
CMD curl -f http://localhost:8000/healthz || exit 1
|
|
|
|
CMD ["uvicorn", "src.app.main:app", "--host", "0.0.0.0", "--port", "8000"] |