-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (31 loc) · 1.22 KB
/
Dockerfile
File metadata and controls
42 lines (31 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
# ── Build ──────────────────────────────────────────
FROM python:3.12-slim AS builder
WORKDIR /build
COPY pyproject.toml .
COPY contribai/ contribai/
COPY README.md .
COPY LICENSE .
RUN pip install --no-cache-dir build && \
python -m build --wheel
# ── Runtime ───────────────────────────────────────
FROM python:3.12-slim
LABEL maintainer="ContribAI Team"
LABEL description="AI Agent for Open Source Contributions"
# Create non-root user
RUN useradd --create-home --shell /bin/bash contribai
WORKDIR /home/contribai
# Install the built wheel
COPY --from=builder /build/dist/*.whl /tmp/
RUN pip install --no-cache-dir /tmp/*.whl && rm /tmp/*.whl
# Create config and data directories
RUN mkdir -p /home/contribai/.contribai && \
chown -R contribai:contribai /home/contribai
# Expose dashboard port
EXPOSE 8787
USER contribai
# Health check for dashboard mode
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD python -c "import httpx; httpx.get('http://localhost:8787/api/health')" || exit 1
# Default: show help
ENTRYPOINT ["contribai"]
CMD ["--help"]