-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
73 lines (56 loc) · 1.5 KB
/
Copy pathDockerfile
File metadata and controls
73 lines (56 loc) · 1.5 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Koru - Closed-loop automation across semcod/* repositories
# Multi-stage build for production and testing
FROM python:3.12-slim as base
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
curl \
docker.io \
jq \
&& rm -rf /var/lib/apt/lists/*
# Cache bust arg — set to src/ hash by the test fixture to force rebuild on code change
ARG CACHE_BUST=none
# Copy source code first
COPY src/ ./src/
COPY templates/ ./templates/
COPY docs/ ./docs/
COPY README.md .
COPY LICENSE* .
COPY pyproject.toml .
# Install Python dependencies
RUN pip install --no-cache-dir -e .
# Install external tools (planfile, regix, testql, etc.)
RUN pip install --no-cache-dir \
planfile>=0.1.87 \
regix>=0.1.0 \
redup>=0.4.15 \
testql>=0.1.0 \
vallm>=0.1.87 \
wup>=0.1.0
# Create non-root user
RUN useradd -m -u 1000 koru && \
chown -R koru:koru /app
USER koru
# Environment variables
ENV PYTHONPATH=/app/src
ENV KORU_AUTOPILOT_IDE=auto
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD koru --doctor || exit 1
ENTRYPOINT ["koru"]
CMD ["--help"]
# Development stage with test dependencies
FROM base as development
USER root
RUN pip install --no-cache-dir -e ".[dev,watch]" && \
chown -R koru:koru /app
USER koru
# Test stage
FROM development as test
# Copy test files
COPY tests/ ./tests/
# Run tests
RUN python -m pytest tests/ -v
# Production stage
FROM base as production