File size: 1,278 Bytes
b9d7594
c79824c
 
 
 
 
 
 
 
 
 
 
 
a9ec4f6
c79824c
 
 
a9ec4f6
 
 
 
f39814a
a9ec4f6
f39814a
 
 
 
 
 
a9ec4f6
 
f39814a
c79824c
 
 
 
 
a9ec4f6
 
 
 
 
b9d7594
4cc66a9
c79824c
a9ec4f6
 
4cc66a9
a9ec4f6
 
4cc66a9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Use Python 3.11 as base image
FROM python:3.11-slim

# Set working directory
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    git \
    && rm -rf /var/lib/apt/lists/*

# Copy and install Python dependencies first (better caching)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY . .

# Create necessary data directories for financial processing
RUN mkdir -p /app/data/input \
    /app/data/output \
    /app/data/output1 \
    /app/data/output2 \
    /app/data/output3 \
    /app/data/csv_notes_bs \
    /app/data/csv_notes_cfs \
    /app/data/csv_notes_pnl \
    /app/data/generated_notes \
    /app/data/generated_notes_excel \
    && chmod -R 777 /app/data

# Set environment variables
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1

# Default agent configuration (can be overridden by .env)
ENV AGENT_MODEL=gpt-3.5-turbo
ENV AGENT_TEMPERATURE=0.1
ENV AGENT_MAX_TOKENS=2000

# Expose the port
EXPOSE 7860

# Health check for the API
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
    CMD curl -f http://localhost:7860/docs || exit 1

# Start FastAPI app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]