-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (34 loc) · 1.03 KB
/
Dockerfile
File metadata and controls
47 lines (34 loc) · 1.03 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
# Multi-stage build with uv package manager
FROM python:3.12-slim AS builder
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
WORKDIR /app
# Copy source code for install
COPY pyproject.toml ./
COPY src/ ./src/
# Install dependencies with increased timeout for large packages
ENV UV_HTTP_TIMEOUT=300
RUN uv venv .venv && \
. .venv/bin/activate && \
uv pip install --no-cache -e .
# Final stage
FROM python:3.12-slim
WORKDIR /app
# Copy virtual environment from builder
COPY --from=builder /app/.venv /app/.venv
# Copy application code
COPY src/ ./src/
COPY knowledge/ ./knowledge/
COPY mcp/ ./mcp/
# Create output directory
RUN mkdir -p /app/output
# Set environment
ENV PATH="/app/.venv/bin:$PATH"
ENV PYTHONPATH="/app/src"
# Expose port
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')" || exit 1
# Run API server
CMD ["python", "-m", "auto_k8s_pilot.api"]