-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (43 loc) · 1.22 KB
/
Dockerfile
File metadata and controls
58 lines (43 loc) · 1.22 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
54
55
56
57
58
# Dockerfile for Self-Correcting Agent Kernel
#
# Multi-stage build for production deployment
# Based on official Python slim image
FROM python:3.11-slim as base
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better layer caching
COPY requirements.txt .
COPY setup.py .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir -e .
# Development stage
FROM base as development
# Install development dependencies
RUN pip install --no-cache-dir pytest pytest-asyncio jupyter streamlit
# Copy source code
COPY . .
# Expose ports
EXPOSE 8501
# Default command for development
CMD ["streamlit", "run", "dashboard.py"]
# Production stage
FROM base as production
# Copy only necessary files
COPY src/ ./src/
COPY agent_kernel/ ./agent_kernel/
COPY cli.py .
# Create non-root user
RUN useradd -m -u 1000 scak && chown -R scak:scak /app
USER scak
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import sys; sys.exit(0)"
# Default command
ENTRYPOINT ["python", "cli.py"]
CMD ["--help"]