-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (40 loc) · 1.58 KB
/
Dockerfile
File metadata and controls
53 lines (40 loc) · 1.58 KB
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
53
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies including DNS utilities
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy pip config for better PyPI connectivity
COPY pip.conf /etc/pip.conf
# Upgrade pip and install build dependencies
RUN pip install --upgrade pip setuptools wheel
# Copy requirements in batches for better reliability
COPY requirements-core.txt /app/requirements-core.txt
COPY requirements-langchain.txt /app/requirements-langchain.txt
COPY requirements-other.txt /app/requirements-other.txt
# Install packages in batches with multiple retry strategies
RUN for i in 1 2 3; do \
pip install --no-cache-dir --prefer-binary -r requirements-core.txt && break || \
(echo "Attempt $i failed, retrying..." && sleep 10); \
done
RUN for i in 1 2 3; do \
pip install --no-cache-dir --prefer-binary -r requirements-langchain.txt && break || \
(echo "Attempt $i failed, retrying..." && sleep 10); \
done
RUN for i in 1 2 3; do \
pip install --no-cache-dir --prefer-binary -r requirements-other.txt && break || \
(echo "Attempt $i failed, retrying..." && sleep 10); \
done
# Copy the entire project (from project root)
COPY . /app/
# Set Python path
ENV PYTHONPATH=/app
# Create necessary directories
RUN mkdir -p /app/dashboard/runs /app/dashboard/runs/agent_sessions
# Expose the port FastAPI will run on
EXPOSE 8000
# Run the FastAPI server
CMD ["uvicorn", "dashboard.server.app:app", "--host", "0.0.0.0", "--port", "8000"]